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 23 additions and 0 deletions
Showing only changes of commit 6fea737a96 - Show all commits

View File

@ -132,6 +132,29 @@ def draw_material_settings(layout, material):
layout.prop(material.node_tree.nodes['Principled BSDF'].inputs[1], 'default_value', text='Metallic') layout.prop(material.node_tree.nodes['Principled BSDF'].inputs[1], 'default_value', text='Metallic')
layout.prop(material.node_tree.nodes['Principled BSDF'].inputs[2], 'default_value', text='Roughness') layout.prop(material.node_tree.nodes['Principled BSDF'].inputs[2], 'default_value', text='Roughness')
effects_header, effects_panel = layout.panel('effects_panel', default_closed = True)
effects_header.label(text='Effects', icon='SHADERFX')
if effects_panel:
draw_effect_panel_recursive(effects_panel, material, material.node_tree.nodes['Effects In'])
def draw_effect_panel_recursive(effects_panel, material, prev_node):
if not prev_node:
return
if not prev_node.outputs[0].links:
return
node = prev_node.outputs[0].links[0].to_node
if node.name == 'Effects Out':
return
header, panel = effects_panel.panel(f'{node.name}_panel', default_closed = True)
header.alignment = 'LEFT'
header.prop(node, 'mute', invert_checkbox=True, icon_only=True)
header.label(text=node.label if node.label else node.name)
if panel:
for input in node.inputs[1:]:
panel.prop(input, 'default_value', text=input.name)
draw_effect_panel_recursive(effects_panel, material, node)
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):
settings = data settings = data