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 14 additions and 2 deletions
Showing only changes of commit 2759bce45f - Show all commits

View File

@ -237,7 +237,19 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
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:
style_panel.prop(settings, 'context_material', icon='MATERIAL') material_header, material_panel = style_panel.panel("brushstrokes_material", default_closed=False)
material_header.label(text='Material')
if material_panel:
material_row = material_panel.row(align=True)
material_row.template_ID(settings, 'context_material')
if settings.context_material:
if getattr(settings.context_material, '["BSBST"]', False):
material_panel.prop(settings.context_material.node_tree.nodes['Opacity'].outputs[0], 'default_value', text='Opacity')
material_panel.prop(settings.context_material.node_tree.nodes['Use Strength'], 'mute', text='Use Brush Strength', invert_checkbox=True)
material_panel.prop(settings.context_material.node_tree.nodes['Color Variation'].inputs[0], 'default_value', text='Color Variation')
material_panel.prop(settings.context_material.node_tree.nodes['Principled BSDF'].inputs[1], 'default_value', text='Metallic')
material_panel.prop(settings.context_material.node_tree.nodes['Principled BSDF'].inputs[2], 'default_value', text='Roughness')
if style_object: if style_object:
for mod in style_object.modifiers: for mod in style_object.modifiers:
@ -251,7 +263,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
mod_header, mod_panel = style_panel.panel(mod.name, default_closed = False) mod_header, mod_panel = style_panel.panel(mod.name, default_closed = False)
row = mod_header.row(align=True) row = mod_header.row(align=True)
row.label(text='', icon='GEOMETRY_NODES') row.label(text='', icon='GEOMETRY_NODES')
row.prop(mod, 'name', text='') row.prop(mod, 'name', text='', emboss=False)
if is_preset: if is_preset:
op = row.operator('brushstroke_tools.preset_remove_mod', text='', icon='X') op = row.operator('brushstroke_tools.preset_remove_mod', text='', icon='X')