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:
authorCampbell Barton <ideasman42@gmail.com>2011-07-25 07:02:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-25 07:02:01 +0400
commiteafdd1414446de79848adc27380dac244c82bb2e (patch)
treec0a044c2a4749bcd96023cf8e01f14ae530272fe /io_mesh_stl
parent3e9408cbe2647b9104f289d0474ff068e7fab494 (diff)
reverse stl export vector rotation order,
also clear temp meshes after export.
Diffstat (limited to 'io_mesh_stl')
-rw-r--r--io_mesh_stl/blender_utils.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index 8d19e30c..2e8c8d6d 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -59,7 +59,9 @@ def faces_from_mesh(ob, apply_modifier=False, triangulate=True):
try:
mesh = ob.to_mesh(bpy.context.scene, apply_modifier, "PREVIEW")
except RuntimeError:
- return ()
+ raise StopIteration
+
+ mesh.transform(ob.matrix_world)
if triangulate:
# 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):
for face in mesh.faces:
yield face.vertices[:]
- return ([(mesh.vertices[index].co * ob.matrix_world)[:]
- for index in indexes] for indexes in iter_face_index())
+ vertices = mesh.vertices
+
+ for indexes in iter_face_index():
+ yield [vertices[index].co.copy() for index in indexes]
+
+ bpy.data.meshes.remove(mesh)