diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-07 18:15:53 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-10-07 18:15:53 +0400 |
commit | e6b174a3b618907ed189c1fe95df7c9b19fc62ca (patch) | |
tree | 995026d3e293ad18041e4b5a307e43e196ac2de1 /io_mesh_stl/blender_utils.py | |
parent | 54eaab823ad64e62c0ba564588ca3812a220d8eb (diff) |
Fix T42000: STL export scale incorrect.
Not a bug, in fact, more like a feature request.
Added an option to take into account scene's scale on both export and import time.
Also added scaling/axis conversion to importer.
Diffstat (limited to 'io_mesh_stl/blender_utils.py')
-rw-r--r-- | io_mesh_stl/blender_utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index a13277ad..6c22cf57 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -21,11 +21,14 @@ import bpy -def create_and_link_mesh(name, faces, points): +def create_and_link_mesh(name, faces, points, global_matrix): """ Create a blender mesh and object called name from a list of *points* and *faces* and link it in the current scene. """ + 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) |