make tweak tools collapsible
This commit is contained in:
@@ -12353,10 +12353,11 @@ Parameters:
|
|||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"pattern": "class DLM_PT_character_migrator",
|
"pattern": "section_expanded",
|
||||||
"path": "t:\\Dynamic-Link-Manager\\ui\\panels.py",
|
"path": "t:\\Dynamic-Link-Manager\\ui\\properties.py",
|
||||||
"outputMode": "content",
|
"outputMode": "content",
|
||||||
"contextAfter": 50,
|
"contextBefore": 2,
|
||||||
|
"contextAfter": 5,
|
||||||
"caseInsensitive": false
|
"caseInsensitive": false
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -12396,19 +12397,8 @@ Let me look at more context around that area.Let me look at the actual draw meth
|
|||||||
---
|
---
|
||||||
|
|
||||||
<tool-use data-tool-type="shell" data-tool-name="run_terminal_command_v2">
|
<tool-use data-tool-type="shell" data-tool-name="run_terminal_command_v2">
|
||||||
<details><summary>Tool use: **run_terminal_command_v2** • Run command: python -c "
|
<details><summary>Tool use: **run_terminal_command_v2**</summary>
|
||||||
with open('t:\\Dynamic-Link-Manager\\ui\\panels.py', 'r') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
for i in range(130, min(200, len(lines))):
|
|
||||||
print(f'{i+1}: {lines[i][:70]}')"</summary>
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python -c "
|
|
||||||
with open('t:\\Dynamic-Link-Manager\\ui\\panels.py', 'r') as f:
|
|
||||||
lines = f.readlines()
|
|
||||||
for i in range(130, min(200, len(lines))):
|
|
||||||
print(f'{i+1}: {lines[i][:70]}')"
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
131: if props.linked_libraries_section_expanded:
|
131: if props.linked_libraries_section_expanded:
|
||||||
@@ -12475,3 +12465,68 @@ with open('t:\\Dynamic-Link-Manager\\ui\\panels.py', 'r') as f:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<think><details><summary>Thought Process</summary>
|
||||||
|
Let me look for the Character Migrator section specifically.The shell seems to be having issues again. Let me use Grep to find the line number.Now I can see the structure. The buttons are on lines 95-99. I need to:
|
||||||
|
1. Move `migrator_basebody_shapekeys` (line 95) and the FKRot buttons (lines 97-99) to a new "Situational" section
|
||||||
|
2. Keep the other migrator buttons (MigBoneConst, RetargRelatives) where they are
|
||||||
|
|
||||||
|
Let me look at what comes before line 92 to understand the full structure.Now I can see the structure. I need to:
|
||||||
|
1. Move `migrator_basebody_shapekeys` (line 95) and the FKRot buttons (lines 96-99) to a new "Situational" section
|
||||||
|
2. Keep MigBoneConst and RetargRelatives in the Character Migrator section
|
||||||
|
|
||||||
|
Let me make the edit.</details></think>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<tool-use data-tool-type="write" data-tool-name="edit_file_v2">
|
||||||
|
|
||||||
|
<details><summary>Tool use: **edit_file_v2** • Edit file: t:\Dynamic-Link-Manager\ui\panels.py</summary>
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
</tool-use>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<think><details><summary>Thought Process</summary>
|
||||||
|
Done. I've moved:
|
||||||
|
- `migrator_basebody_shapekeys` (MigBBodyShapeKeys)
|
||||||
|
- `migrator_fk_rotations` (MigFKRot)
|
||||||
|
- `migrator_fk_rotations_remove` (Remove)
|
||||||
|
- `migrator_fk_rotations_bake` (Bake)
|
||||||
|
|
||||||
|
To a new "Situational" section with its own box layout. The other migrator buttons (MigBoneConst, RetargRelatives) remain in the Character Migrator section.No linter errors. The UI has been reorganized.</details></think>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Done. I've reorganized the UI:
|
||||||
|
|
||||||
|
**Character Migrator** section now has:
|
||||||
|
- MigBoneConst
|
||||||
|
- RetargRelatives
|
||||||
|
|
||||||
|
**New "Situational"** section has:
|
||||||
|
- MigBBodyShapeKeys
|
||||||
|
- MigFKRot | Remove | Bake
|
||||||
|
|
||||||
|
The "Situational" section uses the `QUESTION` icon and is positioned between the Character Migrator and Tweak Tools sections.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**User**_
|
||||||
|
|
||||||
|
Let's make the tweak tools box collapsible, and have it collapsed by default.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**Agent (model kimi-k2.5, mode Agent)**_
|
||||||
|
|
||||||
|
<think><details><summary>Thought Process</summary>
|
||||||
|
The user wants the Tweak Tools box to be collapsible and collapsed by default. I need to add a property to track the collapsed state and modify the UI layout. Let me check the current structure of the panels.py file and how the Tweak Tools section is defined.I see the Tweak Tools section. I need to:
|
||||||
|
1. Add a BoolProperty to the scene to track the collapsed state
|
||||||
|
2. Modify the UI to use a collapsible section with a toggle
|
||||||
|
|
||||||
|
Let me first check the properties file to see where to add the property.Let me look at how other collapsible sections are done in the panels file to follow the same pattern.Let me search in the properties file for the expanded pattern.</details></think>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|||||||
+23
-19
@@ -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_remove", text="Remove", icon="X")
|
||||||
row.operator("dlm.migrator_fk_rotations_bake", text="Bake", icon="KEYFRAME")
|
row.operator("dlm.migrator_fk_rotations_bake", text="Bake", icon="KEYFRAME")
|
||||||
|
|
||||||
# Tweak Tools
|
# Tweak Tools: header row (always), main box only when expanded
|
||||||
tweak_box = layout.box()
|
section_icon = "DISCLOSURE_TRI_DOWN" if props.tweak_tools_section_expanded else "DISCLOSURE_TRI_RIGHT"
|
||||||
tweak_box.label(text="Tweak Tools", icon="CONSTRAINT")
|
row = layout.row(align=True)
|
||||||
row = tweak_box.row(align=True)
|
row.prop(props, "tweak_tools_section_expanded", text="", icon=section_icon, icon_only=True)
|
||||||
row.operator("dlm.tweak_add_arm", text="Add Arm", icon="CONSTRAINT_BONE")
|
row.label(text="Tweak Tools", icon="CONSTRAINT")
|
||||||
row.operator("dlm.tweak_remove_arm", text="Remove Arm", icon="X")
|
if props.tweak_tools_section_expanded:
|
||||||
row.operator("dlm.tweak_bake_arm", text="Bake Arm", icon="KEYFRAME")
|
tweak_box = layout.box()
|
||||||
row = tweak_box.row(align=True)
|
row = tweak_box.row(align=True)
|
||||||
row.operator("dlm.tweak_add_leg", text="Add Leg", icon="CONSTRAINT_BONE")
|
row.operator("dlm.tweak_add_arm", text="Add Arm", icon="CONSTRAINT_BONE")
|
||||||
row.operator("dlm.tweak_remove_leg", text="Remove Leg", icon="X")
|
row.operator("dlm.tweak_remove_arm", text="Remove Arm", icon="X")
|
||||||
row.operator("dlm.tweak_bake_leg", text="Bake Leg", icon="KEYFRAME")
|
row.operator("dlm.tweak_bake_arm", text="Bake Arm", icon="KEYFRAME")
|
||||||
row = tweak_box.row(align=True)
|
row = tweak_box.row(align=True)
|
||||||
row.operator("dlm.tweak_add_both", text="Add Both", icon="CONSTRAINT_BONE")
|
row.operator("dlm.tweak_add_leg", text="Add Leg", icon="CONSTRAINT_BONE")
|
||||||
row.operator("dlm.tweak_remove_both", text="Remove Both", icon="X")
|
row.operator("dlm.tweak_remove_leg", text="Remove Leg", icon="X")
|
||||||
row.operator("dlm.tweak_bake_both", text="Bake Both", icon="KEYFRAME")
|
row.operator("dlm.tweak_bake_leg", text="Bake Leg", icon="KEYFRAME")
|
||||||
row = tweak_box.row()
|
row = tweak_box.row(align=True)
|
||||||
row.prop(props, "tweak_nla_track_name", text="NLA track")
|
row.operator("dlm.tweak_add_both", text="Add Both", icon="CONSTRAINT_BONE")
|
||||||
row = tweak_box.row()
|
row.operator("dlm.tweak_remove_both", text="Remove Both", icon="X")
|
||||||
row.prop(props, "tweak_bake_post_clean", text="Post-clean after bake")
|
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
|
# Linked Libraries: header row (always), main box only when expanded
|
||||||
missing_count = sum(1 for lib in props.linked_libraries if lib.is_missing)
|
missing_count = sum(1 for lib in props.linked_libraries if lib.is_missing)
|
||||||
|
|||||||
+6
-1
@@ -60,7 +60,12 @@ class DynamicLinkManagerProperties(PropertyGroup):
|
|||||||
poll=lambda self, obj: obj and obj.type == "ARMATURE",
|
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(
|
tweak_nla_track_name: StringProperty(
|
||||||
name="NLA Track (bake range)",
|
name="NLA Track (bake range)",
|
||||||
description="If set, bake uses this NLA track on the replacement armature for frame range; else scene range",
|
description="If set, bake uses this NLA track on the replacement armature for frame range; else scene range",
|
||||||
|
|||||||
Reference in New Issue
Block a user