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 a1b55956c8 - Show all commits

View File

@ -143,10 +143,12 @@ class BSBST_Settings(bpy.types.PropertyGroup):
('SURFACE_DRAW', 'Draw', 'Use surface draw method for new brushstroke object', 'LINE_DATA', 1),
])
style_context: bpy.props.EnumProperty(default='AUTO',
items= [('PRESET', 'Preset', 'Specify the style of the current preset used for new brushstrokes', 'SETTINGS', 0),\
('BRUSHSTROKES', 'Brushstrokes', 'Specify the style of the currently active brushstrokes', 'BRUSH_DATA', 1),
('AUTO', 'Auto', 'Specify the style of either the active brushstrokes or the preset depending on the context', 'AUTO', 2),
])
name='Context',
items= [
('PRESET', 'Preset', 'Specify the style of the current preset used for new brushstrokes', 'SETTINGS', 0),\
('BRUSHSTROKES', 'Brushstrokes', 'Specify the style of the currently active brushstrokes', 'BRUSH_DATA', 1),
('AUTO', 'Auto', 'Specify the style of either the active brushstrokes or the preset depending on the context', 'AUTO', 2),
])
try:
gpv3 = bpy.context.preferences.experimental.use_grease_pencil_version3
@ -166,7 +168,9 @@ class BSBST_Settings(bpy.types.PropertyGroup):
update=update_active_brushstrokes,
get=get_active_context_brushstrokes_index,
set=set_active_context_brushstrokes_index)
ui_options: bpy.props.BoolProperty(default=False, name='UI Options')
ui_options: bpy.props.BoolProperty(default=False,
name='UI Options',
description="Show advanced UI options to customize exposed parameters")
classes = [
BSBST_socket_info,

View File

@ -156,7 +156,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
new_advanced_panel.label(text='Curve mode does not support drawing on deformed geometry', icon='ERROR')
new_advanced_panel.prop(settings, 'assign_materials')
new_advanced_panel.prop(settings, 'ui_options', icon='OPTIONS')
new_advanced_panel.prop(settings, 'style_context')
# identify style context
style_object = context.object if settings.style_context=='BRUSHSTROKES' else settings.preset_object
@ -185,7 +185,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
else:
style_header.label(text="Brushstroke Settings", icon='BRUSH_DATA')
style_header.operator('brushstroke_tools.make_preset', text='', icon='DECORATE_OVERRIDE')
style_header.row().prop(settings, 'style_context', icon_only=True, expand=True)
style_header.row().prop(settings, 'ui_options', icon='OPTIONS', icon_only=True)
if style_panel:
if settings.style_context=='BRUSHSTROKES' and not utils.is_brushstrokes_object(style_object):