Brushstroke Tools: Initial Version #328
@ -222,8 +222,7 @@ class BSBST_OT_delete_brushstrokes(bpy.types.Operator):
|
|||||||
edit_toggle = settings.edit_toggle
|
edit_toggle = settings.edit_toggle
|
||||||
settings.edit_toggle = False
|
settings.edit_toggle = False
|
||||||
|
|
||||||
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
|
bs_ob = utils.get_active_context_brushstrokes_object(context)
|
||||||
bs_ob = bpy.data.objects.get(active_bs.name)
|
|
||||||
if not bs_ob:
|
if not bs_ob:
|
||||||
settings.edit_toggle = edit_toggle
|
settings.edit_toggle = edit_toggle
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
@ -515,8 +514,7 @@ class BSBST_OT_brushstrokes_toggle_attribute(bpy.types.Operator):
|
|||||||
edit_toggle = settings.edit_toggle
|
edit_toggle = settings.edit_toggle
|
||||||
settings.edit_toggle = False
|
settings.edit_toggle = False
|
||||||
|
|
||||||
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
|
bs_ob = utils.get_active_context_brushstrokes_object(context)
|
||||||
bs_ob = bpy.data.objects.get(active_bs.name)
|
|
||||||
if not bs_ob:
|
if not bs_ob:
|
||||||
settings.edit_toggle = edit_toggle
|
settings.edit_toggle = edit_toggle
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
@ -206,15 +206,21 @@ def context_brushstrokes(context):
|
|||||||
settings = context.scene.BSBST_settings
|
settings = context.scene.BSBST_settings
|
||||||
return settings.context_brushstrokes
|
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):
|
def flow_name(name):
|
||||||
return f'{name}-FLOW'
|
return f'{name}-FLOW'
|
||||||
|
|
||||||
def edit_active_brushstrokes(context):
|
def edit_active_brushstrokes(context):
|
||||||
context.view_layer.depsgraph.update()
|
context.view_layer.depsgraph.update()
|
||||||
settings = context.scene.BSBST_settings
|
|
||||||
|
|
||||||
active_bs = settings.context_brushstrokes[settings.active_context_brushstrokes_index]
|
bs_ob = get_active_context_brushstrokes_object(context)
|
||||||
bs_ob = bpy.data.objects.get(active_bs.name)
|
|
||||||
if not bs_ob:
|
if not bs_ob:
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user