diff options
author | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:43 +0300 |
---|---|---|
committer | Peter Kim <pk15950@gmail.com> | 2022-09-08 07:00:43 +0300 |
commit | e83f88c951e26b01893acee4f24b40a46062a41c (patch) | |
tree | 09f60bf7d4fc2ae1ef50668823e416fc675b252e /object_print3d_utils/mesh_helpers.py | |
parent | ec84e3294593e2e26475f18c81e847bf00dc201e (diff) | |
parent | 0cd92169d40ae1c7e103ff269e850eaf1b901646 (diff) |
Merge branch 'master' into xr-devxr-dev
Diffstat (limited to 'object_print3d_utils/mesh_helpers.py')
-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) |