Brushstroke Tools: Initial Version #328
@ -201,6 +201,27 @@ class BSBST_OT_new_brushstrokes(bpy.types.Operator):
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
class BSBST_OT_edit_brushstrokes(bpy.types.Operator):
|
||||
"""
|
||||
SimonThommes marked this conversation as resolved
Outdated
|
||||
Enter the editing context for the active context brushstrokes.
|
||||
"""
|
||||
bl_idname = "brushstroke_tools.edit_brushstrokes"
|
||||
bl_label = "Edit Active Brushstrokes"
|
||||
bl_description = " Enter the editing context for the active context brushstrokes"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
settings = context.scene.BSBST_settings
|
||||
return bool(settings.context_brushstrokes)
|
||||
|
||||
def execute(self, context):
|
||||
|
||||
settings = context.scene.BSBST_settings
|
||||
# TODO: refactor entering edit
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
class BSBST_OT_init_preset(bpy.types.Operator):
|
||||
"""
|
||||
Initialize the preset to define a modifier stack applied to new brushstrokess.
|
||||
@ -445,6 +466,7 @@ class BSBST_OT_preset_toggle_attribute(bpy.types.Operator):
|
||||
|
||||
classes = [
|
||||
BSBST_OT_new_brushstrokes,
|
||||
BSBST_OT_edit_brushstrokes,
|
||||
BSBST_OT_init_preset,
|
||||
BSBST_OT_make_preset,
|
||||
BSBST_OT_preset_add_mod,
|
||||
|
@ -178,6 +178,9 @@ class BSBST_Settings(bpy.types.PropertyGroup):
|
||||
reuse_flow: bpy.props.BoolProperty(default=False,
|
||||
name='Re-use Flow Object',
|
||||
description="Re-use flow object from active brushstrokes if applicable")
|
||||
edit_toggle: bpy.props.BoolProperty(default=True,
|
||||
name='Edit Active Brushstrokes',
|
||||
description="Jump into the corresponding edit mode when selecting/creating a brushstrokes layer")
|
||||
|
||||
classes = [
|
||||
BSBST_socket_info,
|
||||
|
@ -193,6 +193,9 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
||||
style_panel.label(text='No Brushstroke Context Found', icon='ERROR')
|
||||
return
|
||||
if not is_preset and len(settings.context_brushstrokes)>0:
|
||||
row = style_panel.row(align=True)
|
||||
row.operator('brushstroke_tools.edit_brushstrokes', icon='GREASEPENCIL')
|
||||
row.prop(settings, 'edit_toggle', icon='RESTRICT_SELECT_OFF' if settings.edit_toggle else 'RESTRICT_SELECT_ON', icon_only=True)
|
||||
style_panel.template_list("BSBST_UL_brushstroke_objects", "", settings, "context_brushstrokes",
|
||||
settings, "active_context_brushstrokes_index", rows=1, maxrows=5, sort_lock=True)
|
||||
style_panel.prop(settings, 'preset_material', icon='MATERIAL')
|
||||
|
Loading…
Reference in New Issue
Block a user
It's not really necessary to have empty return statements.