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 59 additions and 49 deletions
Showing only changes of commit 6774e208a4 - Show all commits

View File

@ -237,6 +237,12 @@ class BSBST_Settings(bpy.types.PropertyGroup):
('BRUSHSTROKES', 'Brushstrokes', 'Specify the style of the currently active brushstrokes', 'BRUSH_DATA', 1), ('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), ('AUTO', 'Auto', 'Specify the style of either the active brushstrokes or the preset depending on the context', 'AUTO', 2),
]) ])
view_tab: bpy.props.EnumProperty(default='MODIFIERS',
name='Context',
items= [
('MODIFIERS', 'Modifiers', 'View Modifiers Settings', 'MODIFIER', 0),
('MATERIAL', 'Material', 'View Material Settings', 'MATERIAL', 1),
])
try: try:
gpv3 = bpy.context.preferences.experimental.use_grease_pencil_version3 gpv3 = bpy.context.preferences.experimental.use_grease_pencil_version3

View File

@ -306,6 +306,10 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
row_edit.operator('brushstroke_tools.edit_brushstrokes', icon='GREASEPENCIL', text = text) row_edit.operator('brushstroke_tools.edit_brushstrokes', icon='GREASEPENCIL', text = text)
row_edit.prop(settings, 'edit_toggle', icon='RESTRICT_SELECT_OFF' if settings.edit_toggle else 'RESTRICT_SELECT_ON', icon_only=True) row_edit.prop(settings, 'edit_toggle', icon='RESTRICT_SELECT_OFF' if settings.edit_toggle else 'RESTRICT_SELECT_ON', icon_only=True)
row = style_panel.row(align=True)
row.prop(settings, 'view_tab', expand=True)
if settings.view_tab == 'MATERIAL':
if not settings.preset_object and is_preset: if not settings.preset_object and is_preset:
style_panel.operator("brushstroke_tools.init_preset", icon='MODIFIER') style_panel.operator("brushstroke_tools.init_preset", icon='MODIFIER')
else: else:
@ -318,7 +322,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
if settings.context_material: if settings.context_material:
if getattr(settings.context_material, '["BSBST"]', False): if getattr(settings.context_material, '["BSBST"]', False):
draw_material_settings(material_panel, settings.context_material) draw_material_settings(material_panel, settings.context_material)
elif settings.view_tab == 'MODIFIERS':
if style_object: if style_object:
for mod in style_object.modifiers: for mod in style_object.modifiers:
mod_info = mod.id_data.modifier_info.get(mod.name) mod_info = mod.id_data.modifier_info.get(mod.name)