Fix T47490: STL: faces not normalized correctly when exporting multiple meshes.

Using new `mesh.flip_normals()` when the mesh is transformed with a negative matrix (mirror along one axis e.g.).
This commit is contained in:
Bastien Montagne 2016-02-28 16:48:08 +01:00
parent 1736c5cf88
commit 0f2f0e4951
Notes: blender-bot 2023-02-14 08:12:22 +01:00
Referenced by issue blender/blender#47490, STL: faces not normalized correctly when exporting multiple meshes
1 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,11 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False, triangulate=Tru
except RuntimeError:
raise StopIteration
mesh.transform(global_matrix * ob.matrix_world)
mat = global_matrix * ob.matrix_world
mesh.transform(mat)
if mat.is_negative:
mesh.flip_normals()
mesh.calc_tessface()
if triangulate:
# From a list of faces, return the face triangulated if needed.