[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2175] trunk/py/scripts/addons/ io_mesh_stl/blender_utils.py: reverse stl export vector rotation order,

Campbell Barton ideasman42 at gmail.com
Mon Jul 25 05:02:04 CEST 2011


Revision: 2175
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2175
Author:   campbellbarton
Date:     2011-07-25 03:02:01 +0000 (Mon, 25 Jul 2011)
Log Message:
-----------
reverse stl export vector rotation order,
        also clear temp meshes after export.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_mesh_stl/blender_utils.py

Modified: trunk/py/scripts/addons/io_mesh_stl/blender_utils.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_stl/blender_utils.py	2011-07-25 02:41:44 UTC (rev 2174)
+++ trunk/py/scripts/addons/io_mesh_stl/blender_utils.py	2011-07-25 03:02:01 UTC (rev 2175)
@@ -59,8 +59,10 @@
     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.
         def iter_face_index():
@@ -76,5 +78,9 @@
             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)



More information about the Bf-extensions-cvs mailing list