diff options
author | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
---|---|---|
committer | NBurn <7nburn@gmail.com> | 2019-01-29 04:04:35 +0300 |
commit | edd2de62eb13284f7e02256701fec1483973018d (patch) | |
tree | 02a6ab0c10b9131e346d2e55b36bfd14873fafa3 /object_fracture/fracture_ops.py | |
parent | bdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff) |
addons: view_layer.objects.active syntax update
Diffstat (limited to 'object_fracture/fracture_ops.py')
-rw-r--r-- | object_fracture/fracture_ops.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/object_fracture/fracture_ops.py b/object_fracture/fracture_ops.py index 6230a685..73e027a3 100644 --- a/object_fracture/fracture_ops.py +++ b/object_fracture/fracture_ops.py @@ -70,7 +70,7 @@ def create_cutter(context, crack_type, scale, roughness): v.co *= scale if crack_type == 'SPHERE_ROUGH': - for v in context.scene.objects.active.data.vertices: + for v in context.view_layer.objects.active.data.vertices: v.co[0] += roughness * scale * 0.2 * (random.random() - 0.5) v.co[1] += roughness * scale * 0.1 * (random.random() - 0.5) v.co[2] += roughness * scale * 0.1 * (random.random() - 0.5) @@ -142,10 +142,10 @@ def getIslands(shard): shards = [] for gi in range(0, gindex): bpy.ops.object.select_all(action='DESELECT') - bpy.context.scene.objects.active = shard + bpy.context.view_layer.objects.active = shard shard.select_set(True) bpy.ops.object.duplicate(linked=False, mode='DUMMY') - a = bpy.context.scene.objects.active + a = bpy.context.view_layer.objects.active sm = a.data print (a.name) @@ -159,7 +159,7 @@ def getIslands(shard): #print('getIslands: ' + str(x)) a.data.vertices[x].select = True - print(bpy.context.scene.objects.active.name) + print(bpy.context.view_layer.objects.active.name) bpy.ops.object.editmode_toggle() bpy.ops.mesh.delete() |