Brushstroke Tools: Initial Version #328
@ -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"}
|
||||
|
@ -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"}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user