make tweak tools collapsible

This commit is contained in:
Nathan
2026-03-10 10:01:14 -06:00
parent b7a83667d6
commit 53927a6880
3 changed files with 99 additions and 35 deletions
+23 -19
View File
@@ -103,25 +103,29 @@ class DLM_PT_main_panel(Panel):
row.operator("dlm.migrator_fk_rotations_remove", text="Remove", icon="X")
row.operator("dlm.migrator_fk_rotations_bake", text="Bake", icon="KEYFRAME")
# Tweak Tools
tweak_box = layout.box()
tweak_box.label(text="Tweak Tools", icon="CONSTRAINT")
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_arm", text="Add Arm", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_arm", text="Remove Arm", icon="X")
row.operator("dlm.tweak_bake_arm", text="Bake Arm", icon="KEYFRAME")
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_leg", text="Add Leg", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_leg", text="Remove Leg", icon="X")
row.operator("dlm.tweak_bake_leg", text="Bake Leg", icon="KEYFRAME")
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_both", text="Add Both", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_both", text="Remove Both", icon="X")
row.operator("dlm.tweak_bake_both", text="Bake Both", icon="KEYFRAME")
row = tweak_box.row()
row.prop(props, "tweak_nla_track_name", text="NLA track")
row = tweak_box.row()
row.prop(props, "tweak_bake_post_clean", text="Post-clean after bake")
# Tweak Tools: header row (always), main box only when expanded
section_icon = "DISCLOSURE_TRI_DOWN" if props.tweak_tools_section_expanded else "DISCLOSURE_TRI_RIGHT"
row = layout.row(align=True)
row.prop(props, "tweak_tools_section_expanded", text="", icon=section_icon, icon_only=True)
row.label(text="Tweak Tools", icon="CONSTRAINT")
if props.tweak_tools_section_expanded:
tweak_box = layout.box()
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_arm", text="Add Arm", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_arm", text="Remove Arm", icon="X")
row.operator("dlm.tweak_bake_arm", text="Bake Arm", icon="KEYFRAME")
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_leg", text="Add Leg", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_leg", text="Remove Leg", icon="X")
row.operator("dlm.tweak_bake_leg", text="Bake Leg", icon="KEYFRAME")
row = tweak_box.row(align=True)
row.operator("dlm.tweak_add_both", text="Add Both", icon="CONSTRAINT_BONE")
row.operator("dlm.tweak_remove_both", text="Remove Both", icon="X")
row.operator("dlm.tweak_bake_both", text="Bake Both", icon="KEYFRAME")
row = tweak_box.row()
row.prop(props, "tweak_nla_track_name", text="NLA track")
row = tweak_box.row()
row.prop(props, "tweak_bake_post_clean", text="Post-clean after bake")
# Linked Libraries: header row (always), main box only when expanded
missing_count = sum(1 for lib in props.linked_libraries if lib.is_missing)
+6 -1
View File
@@ -60,7 +60,12 @@ class DynamicLinkManagerProperties(PropertyGroup):
poll=lambda self, obj: obj and obj.type == "ARMATURE",
)
# Tweak tools (bake frame range and post-clean)
# Tweak tools (collapsible section)
tweak_tools_section_expanded: BoolProperty(
name="Tweak Tools Expanded",
description="Show or hide the Tweak Tools section",
default=False,
)
tweak_nla_track_name: StringProperty(
name="NLA Track (bake range)",
description="If set, bake uses this NLA track on the replacement armature for frame range; else scene range",