diff options
Diffstat (limited to 'object_fracture_crack')
-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') |