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:
authorPeter Kim <pk15950@gmail.com>2022-09-08 07:00:43 +0300
committerPeter Kim <pk15950@gmail.com>2022-09-08 07:00:43 +0300
commite83f88c951e26b01893acee4f24b40a46062a41c (patch)
tree09f60bf7d4fc2ae1ef50668823e416fc675b252e /object_print3d_utils/mesh_helpers.py
parentec84e3294593e2e26475f18c81e847bf00dc201e (diff)
parent0cd92169d40ae1c7e103ff269e850eaf1b901646 (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.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)