diff options
Diffstat (limited to 'io_mesh_stl/blender_utils.py')
-rw-r--r-- | io_mesh_stl/blender_utils.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py index d1b14cf6..8589e196 100644 --- a/io_mesh_stl/blender_utils.py +++ b/io_mesh_stl/blender_utils.py @@ -18,10 +18,6 @@ # <pep8 compliant> -import bpy -import array -from itertools import chain - def create_and_link_mesh(name, faces, face_nors, points, global_matrix): """ @@ -29,6 +25,10 @@ def create_and_link_mesh(name, faces, face_nors, points, global_matrix): *points* and *faces* and link it in the current scene. """ + import array + from itertools import chain + import bpy + mesh = bpy.data.meshes.new(name) mesh.from_pydata(points, [], faces) @@ -77,6 +77,8 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False): Split the quad into two triangles """ + import bpy + # get the editmode data ob.update_from_editmode() |