Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2022-07-11 05:48:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2022-07-11 05:51:09 +0300
commited54c1b1c3cd3a9e42d1fc8f3eec7cb2745f15fc (patch)
tree88f5c4ecd8f7d9d6bbd8fe180bcc9f9ea5cb3c49
parent7ea2e74fc41b2eabdbf639b812082e73823b09d7 (diff)
Fix T99542: 3D print toolbox thickness check causes assertion
Recalculate normals when applying transformation in the 3D print toolbox.
-rw-r--r--object_print3d_utils/mesh_helpers.py8
1 files changed, 7 insertions, 1 deletions
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)