Skip to content
Snippets Groups Projects
Commit eafdd141 authored by Campbell Barton's avatar Campbell Barton
Browse files

reverse stl export vector rotation order,

        also clear temp meshes after export.
parent 3e9408cb
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,9 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True): ...@@ -59,7 +59,9 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
try: try:
mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW") mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW")
except RuntimeError: except RuntimeError:
return () raise StopIteration
mesh.transform(ob.matrix_world)
if triangulate: if triangulate:
# From a list of faces, return the face triangulated if needed. # From a list of faces, return the face triangulated if needed.
...@@ -76,5 +78,9 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True): ...@@ -76,5 +78,9 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
for face in mesh.faces: for face in mesh.faces:
yield face.vertices[:] yield face.vertices[:]
return ([(mesh.vertices[index].co * ob.matrix_world)[:] vertices = mesh.vertices
for index in indexes] for indexes in iter_face_index())
for indexes in iter_face_index():
yield [vertices[index].co.copy() for index in indexes]
bpy.data.meshes.remove(mesh)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment