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 9cb21c19af - Show all commits

View File

@ -108,6 +108,18 @@ def set_brushstroke_name(self, value):
flow_ob.name = flow_name
flow_ob.data.name = flow_name
def get_modifier_name(self):
return self["name"]
def set_modifier_name(self, value):
prev_name = self.get('name')
if not prev_name:
self["name"] = value
return
ob = self.id_data.modifiers.get(prev_name)
ob.name = value
self["name"] = ob.name
def get_hide_viewport_base(self):
return self["hide_viewport_base"]
@ -178,7 +190,7 @@ class BSBST_socket_info(bpy.types.PropertyGroup):
hide_ui: bpy.props.BoolProperty(default=False)
class BSBST_modifier_info(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(default='')
name: bpy.props.StringProperty(default='', get=get_modifier_name, set=set_modifier_name)
hide_ui: bpy.props.BoolProperty(default=False)
socket_info: bpy.props.CollectionProperty(type=BSBST_socket_info)

View File

@ -264,7 +264,7 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
mod_header, mod_panel = style_panel.panel(mod.name, default_closed = False)
row = mod_header.row(align=True)
row.label(text='', icon='GEOMETRY_NODES')
row.prop(mod, 'name', text='', emboss=False)
row.prop(mod_info, 'name', text='', emboss=False)
if display_mode != 0:
mod_header.prop(mod_info, 'hide_ui', icon_only=True, icon='UNPINNED' if mod_info.hide_ui else 'PINNED', emboss=False)