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
2 changed files with 11 additions and 7 deletions
Showing only changes of commit 62d570369e - Show all commits

View File

@ -222,8 +222,7 @@ class BSBST_OT_delete_brushstrokes(bpy.types.Operator):
edit_toggle = settings.edit_toggle
settings.edit_toggle = False
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
bs_ob = bpy.data.objects.get(active_bs.name)
bs_ob = utils.get_active_context_brushstrokes_object(context)
if not bs_ob:
settings.edit_toggle = edit_toggle
return {"CANCELLED"}
@ -515,8 +514,7 @@ class BSBST_OT_brushstrokes_toggle_attribute(bpy.types.Operator):
edit_toggle = settings.edit_toggle
settings.edit_toggle = False
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
bs_ob = bpy.data.objects.get(active_bs.name)
bs_ob = utils.get_active_context_brushstrokes_object(context)
if not bs_ob:
settings.edit_toggle = edit_toggle
return {"CANCELLED"}

View File

@ -206,15 +206,21 @@ def context_brushstrokes(context):
settings = context.scene.BSBST_settings
return settings.context_brushstrokes
def get_active_context_brushstrokes_object(context):
settings = context.scene.BSBST_settings
if not settings.context_brushstrokes:
return None
bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
bs_ob = bpy.data.objects.get(bs.name)
return bs_ob
def flow_name(name):
return f'{name}-FLOW'
def edit_active_brushstrokes(context):
context.view_layer.depsgraph.update()
settings = context.scene.BSBST_settings
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
bs_ob = bpy.data.objects.get(active_bs.name)
bs_ob = get_active_context_brushstrokes_object(context)
if not bs_ob:
return {"CANCELLED"}