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 232708666c - Show all commits

View File

@ -17,6 +17,7 @@ def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode):
link_icon_dict = {bpy.types.NodeTreeInterfaceSocketObject: 'OUTLINER_OB_SURFACE', link_icon_dict = {bpy.types.NodeTreeInterfaceSocketObject: 'OUTLINER_OB_SURFACE',
bpy.types.NodeTreeInterfaceSocketMaterial: 'MATERIAL'} bpy.types.NodeTreeInterfaceSocketMaterial: 'MATERIAL'}
mode_compare = []
for k, v in items: for k, v in items:
if type(v) == bpy.types.NodeTreeInterfacePanel: if type(v) == bpy.types.NodeTreeInterfacePanel:
@ -36,19 +37,32 @@ def draw_panel_ui_recursive(panel, panel_name, mod, items, display_mode):
if display_mode != 0: if display_mode != 0:
subpanel_header.prop(s, 'hide_ui', icon_only=True, icon='REMOVE') subpanel_header.prop(s, 'hide_ui', icon_only=True, icon='REMOVE')
draw_panel_ui_recursive(subpanel, k, mod, v.interface_items.items(), display_mode) draw_panel_ui_recursive(subpanel, k, mod, v.interface_items.items(), display_mode)
mode_compare = []
else: else:
if v.parent.name != panel_name: if v.parent.name != panel_name:
continue continue
if f'{v.identifier}' not in mod.keys(): if f'{v.identifier}' not in mod.keys():
continue continue
if not mod_info: if not mod_info:
continue continue
if type(v) == bpy.types.NodeTreeInterfaceSocketMenu:
for item in mod.id_properties_ui(f'{v.identifier}').as_dict()['items']:
if item[4] == mod[f'{v.identifier}']:
continue
mode_compare += [item[0]]
s = mod_info.socket_info.get(v.identifier) s = mod_info.socket_info.get(v.identifier)
if not s: if not s:
continue continue
if display_mode == 0: if display_mode == 0:
comp_match = False
for c in mode_compare:
comp_match = c in v.name
if comp_match:
break
if comp_match:
continue
if s.hide_ui: if s.hide_ui:
continue continue
row = panel.row(align=True) row = panel.row(align=True)