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 523232bc59 - Show all commits

View File

@ -117,15 +117,15 @@ def icon_from_link_type(link_type):
else: else:
return {k : i for i, k in enumerate(bpy.types.UILayout.bl_rna.functions["prop"].parameters["icon"].enum_items.keys())}[icon] return {k : i for i, k in enumerate(bpy.types.UILayout.bl_rna.functions["prop"].parameters["icon"].enum_items.keys())}[icon]
class BSBST_link_context_setting(bpy.types.PropertyGroup): class BSBST_socket_info(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(default='') name: bpy.props.StringProperty(default='')
link_context: bpy.props.BoolProperty(default=False, name='Link to Context') link_context: bpy.props.BoolProperty(default=False, name='Link to Context')
link_context_type: bpy.props.EnumProperty(default=1, name='Link to Context', update=update_link_context_type, link_context_type: bpy.props.EnumProperty(default=1, name='Link to Context', update=update_link_context_type,
items=link_context_type_items) items=link_context_type_items)
class BSBST_socket_info(bpy.types.PropertyGroup): class BSBST_modifier_info(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(default='') name: bpy.props.StringProperty(default='')
socket_info: bpy.props.CollectionProperty(type=BSBST_link_context_setting) socket_info: bpy.props.CollectionProperty(type=BSBST_socket_info)
class BSBST_context_brushstrokes(bpy.types.PropertyGroup): class BSBST_context_brushstrokes(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(default='', get=get_brushstroke_name, set=set_brushstroke_name) name: bpy.props.StringProperty(default='', get=get_brushstroke_name, set=set_brushstroke_name)
@ -166,8 +166,8 @@ class BSBST_Settings(bpy.types.PropertyGroup):
set=set_active_context_brushstrokes_index) set=set_active_context_brushstrokes_index)
classes = [ classes = [
BSBST_link_context_setting,
BSBST_socket_info, BSBST_socket_info,
BSBST_modifier_info,
BSBST_context_brushstrokes, BSBST_context_brushstrokes,
BSBST_Settings, BSBST_Settings,
] ]
@ -176,7 +176,7 @@ def register():
for c in classes: for c in classes:
bpy.utils.register_class(c) bpy.utils.register_class(c)
bpy.types.Scene.BSBST_settings = bpy.props.PointerProperty(type=BSBST_Settings) bpy.types.Scene.BSBST_settings = bpy.props.PointerProperty(type=BSBST_Settings)
bpy.types.Object.modifier_info = bpy.props.CollectionProperty(type=BSBST_socket_info) bpy.types.Object.modifier_info = bpy.props.CollectionProperty(type=BSBST_modifier_info)
bpy.app.handlers.depsgraph_update_post.append(find_context_brushstrokes) bpy.app.handlers.depsgraph_update_post.append(find_context_brushstrokes)