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:
authorNBurn <7nburn@gmail.com>2019-01-29 18:54:49 +0300
committerNBurn <7nburn@gmail.com>2019-01-29 18:54:49 +0300
commitd609009748a604c1df2d8babfa4098260666d01a (patch)
tree98150e04df48252889e2fc8e049c13115e0afe72 /mesh_carver.py
parent5c994fde52196dfe8a7e0db03b6935bac001d353 (diff)
addons: objects.link/unlink syntax update
Changed objects.link and objects.unlink from scene to collection
Diffstat (limited to 'mesh_carver.py')
-rw-r--r--mesh_carver.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/mesh_carver.py b/mesh_carver.py
index 9b158f47..b8c14d8c 100644
--- a/mesh_carver.py
+++ b/mesh_carver.py
@@ -1340,7 +1340,7 @@ def CreateCutSquare(self, context):
PlaneNormalised = PlaneNormal.normalized()
# Link object to scene
- context.scene.objects.link(ob)
+ context.collection.objects.link(ob)
# New bmesh
t_bm = bmesh.new()
@@ -1406,7 +1406,7 @@ def CreateCutLine(self, context):
PlaneNormal = depthLocation
PlaneNormalised = PlaneNormal.normalized()
- context.scene.objects.link(ob)
+ context.collection.objects.link(ob)
t_bm = bmesh.new()
t_bm.from_mesh(me)
@@ -1505,7 +1505,7 @@ def CreateCutCircle(self, context):
PlaneNormal = depthLocation
PlaneNormalised = PlaneNormal.normalized()
- context.scene.objects.link(ob)
+ context.collection.objects.link(ob)
t_bm = bmesh.new()
t_bm.from_mesh(me)
@@ -3080,9 +3080,8 @@ class Carver(bpy.types.Operator):
# Copy the brush object
ob = bpy.data.objects.new("CarverBrushCopy", context.object.data.copy())
ob.location = self.ObjectBrush.location
- scene = context.scene
- scene.objects.link(ob)
- scene.update()
+ context.collection.objects.link(ob)
+ context.scene.update()
# Get default variables
self.InitBrushPosition = self.ObjectBrush.location.copy()