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_crack/crack_it.py | |
parent | bdc109a5309b26c718a3ae0ca6f2393c731fde0d (diff) |
addons: view_layer.objects.active syntax update
Diffstat (limited to 'object_fracture_crack/crack_it.py')
-rw-r--r-- | object_fracture_crack/crack_it.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/object_fracture_crack/crack_it.py b/object_fracture_crack/crack_it.py index 96d1abfd..68857908 100644 --- a/object_fracture_crack/crack_it.py +++ b/object_fracture_crack/crack_it.py @@ -48,7 +48,7 @@ def makeFracture(child_verts=False, division=100, noise=0.00, scaleX=1.00, scaleY=1.00, scaleZ=1.00, recursion=0, margin=0.001): # Get active object name and active layer - active_name = bpy.context.scene.objects.active.name + active_name = bpy.context.view_layer.objects.active.name active_layer = bpy.context.scene.active_layer # source method of whether use child verts @@ -81,7 +81,7 @@ def _makeJoin(active_name, active_layer): if fractures: # Execute join - bpy.context.scene.objects.active = fractures[0] + bpy.context.view_layer.objects.active = fractures[0] fractures[0].select_set(True) bpy.ops.object.join() else: @@ -91,7 +91,7 @@ def _makeJoin(active_name, active_layer): ) # Change name - bpy.context.scene.objects.active.name = active_name + '_crack' + bpy.context.view_layer.objects.active.name = active_name + '_crack' # Change origin bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN') |