Brushstroke Tools: Initial Version #328

Merged
Simon Thommes merged 229 commits from SimonThommes/blender-studio-tools:brushstroke_tools-initial-version into main 2024-11-06 15:03:47 +01:00
Showing only changes of commit 4f5fd36e23 - Show all commits

View File

@ -295,6 +295,7 @@ class BSBST_OT_delete_brushstrokes(bpy.types.Operator):
flow_object = utils.get_flow_object(bs_ob)
if context.active_object:
if context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
bpy.data.objects.remove(bs_ob)
settings.active_context_brushstrokes_index = max(0, settings.active_context_brushstrokes_index-1)
@ -340,9 +341,11 @@ class BSBST_OT_duplicate_brushstrokes(bpy.types.Operator):
flow_object = utils.get_flow_object(bs_ob)
if context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
bpy.context.view_layer.objects.active = bs_ob
if context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
for ob in bpy.data.objects:
ob.select_set(False)
@ -409,6 +412,7 @@ class BSBST_OT_copy_brushstrokes(bpy.types.Operator):
if not bs_objects:
return {"CANCELLED"}
if context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
for surface_object in surface_objects:
for ob in bpy.data.objects: