diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 18:54:49 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 18:54:49 +0300 |
commit | d609009748a604c1df2d8babfa4098260666d01a (patch) | |
tree | 98150e04df48252889e2fc8e049c13115e0afe72 /object_fracture/fracture_ops.py | |
parent | 5c994fde52196dfe8a7e0db03b6935bac001d353 (diff) |
addons: objects.link/unlink syntax update
Changed objects.link and objects.unlink from scene to collection
Diffstat (limited to 'object_fracture/fracture_ops.py')
-rw-r--r-- | object_fracture/fracture_ops.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 7d24116a..30515f59 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -169,7 +169,7 @@ def getIslands(shard): shards.append(a) - bpy.context.scene.objects.unlink(shard) + bpy.context.collection.objects.unlink(shard) return shards @@ -233,6 +233,7 @@ def boolop(ob, cutter, op): def splitobject(context, ob, crack_type, roughness): + collection = context.collection scene = context.scene view_layer = context.view_layer @@ -262,17 +263,17 @@ def splitobject(context, ob, crack_type, roughness): if fault > 0: # Delete all shards in case of fault from previous operation. for s in shards: - scene.objects.unlink(s) + collection.objects.unlink(s) - scene.objects.unlink(cutter) + collection.objects.unlink(cutter) #print('splitobject: fault') return [ob] if shards[0] != ob: - bpy.context.scene.objects.unlink(ob) + bpy.context.collection.objects.unlink(ob) - bpy.context.scene.objects.unlink(cutter) + bpy.context.collection.objects.unlink(cutter) return shards @@ -331,7 +332,7 @@ def fracture_group(context, group): if fault == 1: # Delete all shards in case of fault from previous operation. for s in shards: - bpy.context.scene.objects.unlink(s) + bpy.context.collection.objects.unlink(s) #print('fracture_group: fault') #print('fracture_group: ' + str(i)) |