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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-02-28 18:48:08 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-02-28 18:48:08 +0300
commit0f2f0e49517612db379f7f2958b1d1967e7e9e19 (patch)
treefac20f151fe2e341d2d18d3c2037c5309fd3c3f4 /io_mesh_stl
parent1736c5cf882b2f2ffa2896a4e34aba9b7eda5615 (diff)
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.).
Diffstat (limited to 'io_mesh_stl')
-rw-r--r--io_mesh_stl/blender_utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index a5492d07..864335ab 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -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.