[Bf-extensions-cvs] [755af06] master: STL import: Better to transform whole mesh at once, rather than each point in py.

Bastien Montagne noreply at git.blender.org
Tue Oct 7 16:26:39 CEST 2014


Commit: 755af06fd32d5737b0b6f3bb2a70dd78f510cba9
Author: Bastien Montagne
Date:   Tue Oct 7 16:25:55 2014 +0200
Branches: master
https://developer.blender.org/rBA755af06fd32d5737b0b6f3bb2a70dd78f510cba9

STL import: Better to transform whole mesh at once, rather than each point in py.

Thanks Campbell for the headup.

===================================================================

M	io_mesh_stl/blender_utils.py

===================================================================

diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index 6c22cf5..c4e7374 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -28,10 +28,9 @@ def create_and_link_mesh(name, faces, points, global_matrix):
     """
     from mathutils import Vector
 
-    points = tuple(global_matrix * Vector(p) for p in points)
-
     mesh = bpy.data.meshes.new(name)
     mesh.from_pydata(points, [], faces)
+    mesh.transform(global_matrix)
 
     # update mesh to allow proper display
     mesh.validate()



More information about the Bf-extensions-cvs mailing list