Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2018-09-26 12:00:27 +0300
committerJacques Lucke <mail@jlucke.com>2018-09-26 12:04:40 +0300
commit08f39b75b9bf459d7b2cd2a06a258abdcebba840 (patch)
treee4005812f0fef06afc486d06a5a9d06b03ea1aab /io_mesh_stl/blender_utils.py
parentc1784de17c70135a05f3212652fef98d5c2055b2 (diff)
Port 'STL format' addon to Blender 2.8
Reviewers: brecht Differential Revision: https://developer.blender.org/D3730
Diffstat (limited to 'io_mesh_stl/blender_utils.py')
-rw-r--r--io_mesh_stl/blender_utils.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/io_mesh_stl/blender_utils.py b/io_mesh_stl/blender_utils.py
index d6ee400c..3c895560 100644
--- a/io_mesh_stl/blender_utils.py
+++ b/io_mesh_stl/blender_utils.py
@@ -57,12 +57,10 @@ def create_and_link_mesh(name, faces, face_nors, points, global_matrix):
mesh.update()
- scene = bpy.context.scene
-
obj = bpy.data.objects.new(name, mesh)
- scene.objects.link(obj)
- scene.objects.active = obj
- obj.select = True
+ bpy.context.collection.objects.link(obj)
+ bpy.context.view_layer.objects.active = obj
+ obj.select_set("SELECT")
def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False, triangulate=True):
@@ -88,7 +86,7 @@ def faces_from_mesh(ob, global_matrix, use_mesh_modifiers=False, triangulate=Tru
except RuntimeError:
raise StopIteration
- mat = global_matrix * ob.matrix_world
+ mat = global_matrix @ ob.matrix_world
mesh.transform(mat)
if mat.is_negative:
mesh.flip_normals()