Fix T99542: 3D print toolbox thickness check causes assertion

Recalculate normals when applying transformation in the 3D print toolbox.
This commit is contained in:
Campbell Barton 2022-07-11 12:48:39 +10:00
parent 7ea2e74fc4
commit ed54c1b1c3
Notes: blender-bot 2023-02-13 14:59:32 +01:00
Referenced by issue blender/blender#99542, Assertion at bmesh_polygon.c:961 ... BM_face_is_normal_valid(f)
1 changed files with 7 additions and 1 deletions

View File

@ -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)