diff options
author | Campbell Barton <ideasman42@gmail.com> | 2022-07-11 05:48:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2022-07-11 05:51:09 +0300 |
commit | ed54c1b1c3cd3a9e42d1fc8f3eec7cb2745f15fc (patch) | |
tree | 88f5c4ecd8f7d9d6bbd8fe180bcc9f9ea5cb3c49 /object_print3d_utils | |
parent | 7ea2e74fc41b2eabdbf639b812082e73823b09d7 (diff) |
Fix T99542: 3D print toolbox thickness check causes assertion
Recalculate normals when applying transformation in the 3D print toolbox.
Diffstat (limited to 'object_print3d_utils')
-rw-r--r-- | object_print3d_utils/mesh_helpers.py | 8 |
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) |