Skip to content
Snippets Groups Projects
Commit 755af06f authored by Bastien Montagne's avatar Bastien Montagne
Browse files

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

Thanks Campbell for the headup.
parent e6b174a3
Branches
Tags
No related merge requests found
...@@ -28,10 +28,9 @@ def create_and_link_mesh(name, faces, points, global_matrix): ...@@ -28,10 +28,9 @@ def create_and_link_mesh(name, faces, points, global_matrix):
""" """
from mathutils import Vector from mathutils import Vector
points = tuple(global_matrix * Vector(p) for p in points)
mesh = bpy.data.meshes.new(name) mesh = bpy.data.meshes.new(name)
mesh.from_pydata(points, [], faces) mesh.from_pydata(points, [], faces)
mesh.transform(global_matrix)
# update mesh to allow proper display # update mesh to allow proper display
mesh.validate() mesh.validate()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment