[Bf-extensions-cvs] [ed54c1b1] master: Fix T99542: 3D print toolbox thickness check causes assertion
Campbell Barton
noreply at git.blender.org
Mon Jul 11 04:50:52 CEST 2022
Commit: ed54c1b1c3cd3a9e42d1fc8f3eec7cb2745f15fc
Author: Campbell Barton
Date: Mon Jul 11 12:48:39 2022 +1000
Branches: master
https://developer.blender.org/rBAed54c1b1c3cd3a9e42d1fc8f3eec7cb2745f15fc
Fix T99542: 3D print toolbox thickness check causes assertion
Recalculate normals when applying transformation in the 3D print toolbox.
===================================================================
M object_print3d_utils/mesh_helpers.py
===================================================================
diff --git a/object_print3d_utils/mesh_helpers.py b/object_print3d_utils/mesh_helpers.py
index 7d23a078..444df1f1 100644
--- a/object_print3d_utils/mesh_helpers.py
+++ b/object_print3d_utils/mesh_helpers.py
@@ -32,7 +32,13 @@ def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifier
# would save ram
if transform:
- bm.transform(obj.matrix_world)
+ matrix = obj.matrix_world.copy()
+ if not matrix.is_identity:
+ bm.transform(matrix)
+ # Update normals if the matrix has no rotation.
+ matrix.translation.zero()
+ if not matrix.is_identity:
+ bm.normal_update()
if triangulate:
bmesh.ops.triangulate(bm, faces=bm.faces)
More information about the Bf-extensions-cvs
mailing list