[Bf-blender-cvs] [1c23a067069] master: Fix: Applying object transform can create normal layers

Hans Goudey noreply at git.blender.org
Fri Jan 21 23:04:32 CET 2022


Commit: 1c23a067069463190b084af9560d4fe6263e6fe2
Author: Hans Goudey
Date:   Fri Jan 21 16:04:16 2022 -0600
Branches: master
https://developer.blender.org/rB1c23a067069463190b084af9560d4fe6263e6fe2

Fix: Applying object transform can create normal layers

Because this operator is used on original objects, it's best to tag
the normals dirty instead of explicitly calculating them, to avoid
unnecessarily storing normal layers on an original object (since
they might have to be recalculated during evaluation anyway).
There may be other places this change is helpful, but being
conservative is likely better for now.

Related to T95125

===================================================================

M	source/blender/editors/object/object_transform.c

===================================================================

diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index c320313643d..6d04bd3f9d5 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -811,8 +811,8 @@ static int apply_objects_internal(bContext *C,
       /* adjust data */
       BKE_mesh_transform(me, mat, true);
 
-      /* update normals */
-      BKE_mesh_calc_normals(me);
+      /* If normal layers exist, they are now dirty. */
+      BKE_mesh_normals_tag_dirty(me);
     }
     else if (ob->type == OB_ARMATURE) {
       bArmature *arm = ob->data;



More information about the Bf-blender-cvs mailing list