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
Showing only changes of commit d14d95a5d9 - Show all commits

View File

@ -2,7 +2,7 @@ import bpy
from . import utils from . import utils
from . import settings as settings_py from . import settings as settings_py
def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode): def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode, hide_panel=False):
scene = bpy.context.scene scene = bpy.context.scene
settings = scene.BSBST_settings settings = scene.BSBST_settings
@ -35,8 +35,10 @@ def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode):
subpanel_header, subpanel = panel.panel(k, default_closed = v.default_closed) subpanel_header, subpanel = panel.panel(k, default_closed = v.default_closed)
subpanel_header.label(text=k) subpanel_header.label(text=k)
if display_mode != 0: if display_mode != 0:
subpanel_header.prop(s, 'hide_ui', icon_only=True, icon='REMOVE') col = subpanel_header.column()
draw_panel_ui_recursive(subpanel, k, mod, v.interface_items.items(), display_mode) col.active = not (mod_info.hide_ui or hide_panel)
col.prop(s, 'hide_ui', icon_only=True, icon='UNPINNED' if s.hide_ui else 'PINNED', emboss=False)
draw_panel_ui_recursive(subpanel, k, mod, v.interface_items.items(), display_mode, s.hide_ui)
mode_compare = [] mode_compare = []
else: else:
if v.parent.name != panel_name: if v.parent.name != panel_name:
@ -66,6 +68,7 @@ def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode):
if s.hide_ui: if s.hide_ui:
continue continue
row = panel.row(align=True) row = panel.row(align=True)
row.active = not (mod_info.hide_ui or hide_panel or s.hide_ui)
col = row.column() col = row.column()
input_row = col.row(align=True) input_row = col.row(align=True)
@ -100,7 +103,9 @@ def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode):
if display_mode == -1: if display_mode == -1:
row.prop(s, 'link_context_type', text='', emboss=True, icon='LINKED', icon_only=True) row.prop(s, 'link_context_type', text='', emboss=True, icon='LINKED', icon_only=True)
if display_mode != 0: if display_mode != 0:
row.prop(s, 'hide_ui', icon_only=True, icon='REMOVE') col = row.column()
col.active = not (mod_info.hide_ui or hide_panel)
col.prop(s, 'hide_ui', icon_only=True, icon='UNPINNED' if s.hide_ui else 'PINNED', emboss=False)
class BSBST_UL_brushstroke_objects(bpy.types.UIList): class BSBST_UL_brushstroke_objects(bpy.types.UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname): def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
@ -222,7 +227,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
op = row.operator('object.modifier_remove', text='', icon='X') op = row.operator('object.modifier_remove', text='', icon='X')
op.modifier = mod.name op.modifier = mod.name
if display_mode != 0: if display_mode != 0:
mod_header.prop(mod_info, 'hide_ui', icon_only=True, icon='REMOVE') mod_header.prop(mod_info, 'hide_ui', icon_only=True, icon='UNPINNED' if mod_info.hide_ui else 'PINNED', emboss=False)
if not mod_panel: if not mod_panel:
continue continue