separate functions into situational fixes

This commit is contained in:
Nathan
2026-03-10 09:58:15 -06:00
parent 0299cc5aef
commit b7a83667d6
2 changed files with 260 additions and 12 deletions
@@ -12111,10 +12111,10 @@ Parameters:
```json
{
"pattern": "nla.bake completed",
"path": "t:\\Dynamic-Link-Manager\\ops\\fk_rotations.py",
"pattern": "Situational",
"path": "t:\\Dynamic-Link-Manager\\ui\\panels.py",
"outputMode": "content",
"contextAfter": 30,
"contextAfter": 8,
"caseInsensitive": false
}
```
@@ -12123,12 +12123,17 @@ Additional data:
```json
{
"isPruned": true,
"pattern": "nla.bake completed",
"pattern": "_extract_bone_name_from_data_path",
"path": "t:\\Dynamic-Link-Manager\\ops\\fk_rotations.py",
"outputMode": "content",
"totalFiles": 0,
"totalMatches": 0,
"topFiles": []
"totalFiles": 1,
"totalMatches": 1,
"topFiles": [
{
"uri": "ops\\fk_rotations.py",
"matchCount": 1
}
]
}
```
Status: **completed**
@@ -12146,7 +12151,7 @@ Status: **completed**
<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\ops\fk_rotations.py</summary>
<details><summary>Tool use: **edit_file_v2** • Edit file: t:\Dynamic-Link-Manager\ui\panels.py</summary>
</details>
@@ -12222,9 +12227,7 @@ Actually, looking at the bone selection API in Blender:
<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\ops\fk_rotations.py</summary>
Status: **loading**
<details><summary>Tool use: **edit_file_v2** • Edit file: t:\Dynamic-Link-Manager\ui\panels.py</summary>
</details>
@@ -12232,3 +12235,243 @@ Status: **loading**
---
<think><details><summary>Thought Process</summary>
Now I need to remove the unused helper function since we're not using the fcurve cleanup approach anymore. Let me check if it's still being called anywhere.The helper function is defined but no longer used since we switched to the bone selection approach. I can leave it there for now since it's not hurting anything.
Let me verify the code looks correct and test it.</details></think>
---
<tool-use data-tool-type="unknown" data-tool-name="read_lints">
<details>
<summary>Tool use: **read_lints**</summary>
Parameters:
```json
{
"paths": [
"t:\\Dynamic-Link-Manager\\ui\\panels.py"
]
}
```
Result:
```json
{
"linterErrorsByFile": [
{
"relativeWorkspacePath": "t:\\Dynamic-Link-Manager\\ui\\panels.py"
}
]
}
```
Status: **completed**
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
The code looks good. Now we:
1. Select only the FK bones (trying multiple methods for Blender 5.0 compatibility)
2. Run nla.bake with only_selected=True
3. This should only bake the selected FK bones
Let me verify the complete bake function looks correct.</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: t:\Dynamic-Link-Manager\ui\panels.py</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
The code looks good. Now the bake function:
1. Selects only the FK bones using `bpy.ops.pose.select_all(action='DESELECT')` then setting `select = True` on each FK bone
2. Runs `nla.bake` with `only_selected=True` to only bake those selected bones
3. This avoids the complexity of cleaning up fcurves afterward
Let me verify the selection code works properly.</details></think>
---
The bake function now uses `only_selected=True`:
1. **Deselects all bones** with `bpy.ops.pose.select_all(action='DESELECT')`
2. **Selects only FK bones** (tries both `rep_bone.select = True` and `rep_bone.bone.select = True` for Blender 5.0 compatibility)
3. **Runs nla.bake with only_selected=True** - this only bakes the selected FK bones
Please reload the addon and test:
1. Run **MigFKRot** (copies rotations, keeps constraints active)
2. Run **Bake** (selects only FK bones → bakes only those bones → creates NLA track)
3. Check if only arms/fingers are baked, not hips/feet
---
_**User**_
Let's move the FKRot functions and bpy.ops.dlm.migrator_basebody_shapekeys() to their own section named "Situational"
---
_**Agent (model kimi-k2.5, mode Agent)**_
<think><details><summary>Thought Process</summary>
The user wants to reorganize the UI - move the FKRot functions (MigFKRot, Bake, Remove) and the MigBaseBodyShapekeys operator to a new section called "Situational" in the panel.
Let me first check the current panel structure to understand how it's organized.</details></think>
---
<tool-use data-tool-type="read" data-tool-name="read_file_v2">
<details><summary>Tool use: **read_file_v2** • Read file: t:\Dynamic-Link-Manager\ui\panels.py</summary>
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
Let me read more of the panels.py to find where the Character Migrator section is and where the FKRot buttons are.</details></think>
---
<tool-use data-tool-type="unknown" data-tool-name="ripgrep_raw_search">
<details>
<summary>Tool use: **ripgrep_raw_search**</summary>
Parameters:
```json
{
"pattern": "class DLM_PT_character_migrator",
"path": "t:\\Dynamic-Link-Manager\\ui\\panels.py",
"outputMode": "content",
"contextAfter": 50,
"caseInsensitive": false
}
```
Additional data:
```json
{
"isPruned": true,
"pattern": "migrator_fk_rotations",
"path": "t:\\Dynamic-Link-Manager\\ui\\panels.py",
"outputMode": "content",
"totalFiles": 1,
"totalMatches": 3,
"topFiles": [
{
"uri": "ui\\panels.py",
"matchCount": 13
}
]
}
```
Status: **completed**
</details>
</tool-use>
---
<think><details><summary>Thought Process</summary>
I see the current layout. The FKRot buttons are in the Character Migrator section. I need to:
1. Move MigBaseBodyShapeKeys and the FKRot buttons to a new "Situational" section
2. Keep the other migrator buttons where they are
Let me look at more context around that area.Let me look at the actual draw method where the buttons are defined.The file seems to have duplicate content. Let me search for the DLM_PT_character_migrator class.Let me look at the full draw method to see where the box starts and how it's structured.The file content appears corrupted with duplicate content. Let me check the actual structure of the draw method by looking for the class definition.</details></think>
---
<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 "
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:
132: box = layout.box()
133: row = box.row()
134: row.operator("dlm.scan_linked_assets", text="Scan Linked A
135: if props.linked_assets_count &gt; 0:
136: row = box.row()
137: row.template_list("DLM_UL_library_list", "", props, "l
138: row = box.row()
139: row.operator("dlm.reload_libraries", text="Reload Libr
140: prefs = context.preferences.addons.get(__package__.rsp
141: if prefs and prefs.preferences.search_paths:
142: for i, path_item in enumerate(prefs.preferences.se
143: row = box.row()
144: row.prop(path_item, "path", text=f"Search path
145: row.operator("dlm.browse_search_path", text=""
146: row.operator("dlm.remove_search_path", text=""
147: row = box.row()
148: row.alignment = "RIGHT"
149: row.operator("dlm.add_search_path", text="Add search p
150: if missing_count &gt; 0:
151: row = box.row()
152: row.operator("dlm.find_libraries_in_folders", text
153: if props.linked_libraries and 0 &lt;= props.linked_librar
154: selected_lib = props.linked_libraries[props.linked
155: info_box = box.box()
156: if selected_lib.is_missing:
157: info_box.alert = True
158: info_box.label(text=f"Selected: {selected_lib.name
159: if selected_lib.is_missing:
160: info_box.label(text="Status: MISSING", icon="E
161: elif selected_lib.is_indirect:
162: info_box.label(text="Status: INDIRECT", icon="
163: else:
164: info_box.label(text="Status: OK", icon="FILE_B
165: info_box.label(text=f"Path: {selected_lib.filepath
166: info_box.operator("dlm.open_linked_file", text="Op
167: op = info_box.operator("dlm.relocate_single_librar
168: op.target_filepath = selected_lib.filepath
```
</details>
</tool-use>
---
+6 -1
View File
@@ -92,8 +92,13 @@ class DLM_PT_main_panel(Panel):
row = box.row(align=True)
row.operator("dlm.migrator_bone_constraints", text="MigBoneConst", icon="CONSTRAINT_BONE")
row.operator("dlm.migrator_retarget_relations", text="RetargRelatives", icon="ORIENTATION_PARENT")
# Situational
situational_box = layout.box()
situational_box.label(text="Situational Fixes", icon="QUESTION")
row = situational_box.row(align=True)
row.operator("dlm.migrator_basebody_shapekeys", text="MigBBodyShapeKeys", icon="SHAPEKEY_DATA")
row = box.row(align=True)
row = situational_box.row(align=True)
row.operator("dlm.migrator_fk_rotations", text="MigFKRot", icon="BONE_DATA")
row.operator("dlm.migrator_fk_rotations_remove", text="Remove", icon="X")
row.operator("dlm.migrator_fk_rotations_bake", text="Bake", icon="KEYFRAME")