From d6af7b3ebe2ffde1df0873ccddc419ba263b45f3 Mon Sep 17 00:00:00 2001 From: type-two Date: Sat, 25 Jul 2026 21:40:45 +1000 Subject: [PATCH] fix: FBX take name actually works (was still 'Armature|Scene' after the last attempt) The previous fix renamed the baked ACTION, but Blender's FBX exporter builds the AnimStack name from scene.name (io_scene_fbx/export_fbx_bin.py), so every clip still exported the take 'Scene' -> imported back as 'Armature|Scene'. Verified failing on wan_dig_t3.fbx, which was built AFTER that commit. Now sets bpy.context.scene.name = name before export. Both stated acceptances pass: strings clips_out/wan_dig_t3.fbx | grep wan_dig_t3 -> 6 hits Blender import -> 'Armature|wan_dig_t3' Re-exported wan_walk_t1 + wan_dig_t3; takes are distinct, so they can no longer collide in the 24-track female_game bank. Co-Authored-By: Claude Opus 4.8 --- retarget.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/retarget.py b/retarget.py index c41b5eb..764f3b9 100644 --- a/retarget.py +++ b/retarget.py @@ -244,9 +244,12 @@ def main(): f0, f1 = trim_bookends(target, f0, f1) fbx = outdir / f"{name}.fbx" - # the FBX take inherits the action name — un-named it exports as 'Armature|Scene' for EVERY clip, - # colliding in any take-addressed bank (Unreal/3GOD). merge_anims renames from the filename, but - # the take itself must be right (PROGRESS.md bug, fixed 2026-07-17). + # FBX take naming: the exporter builds the AnimStack from **scene.name**, NOT the action name + # (io_scene_fbx/export_fbx_bin.py — `name = ... else scene.name`). Renaming only the action left + # every clip exporting as the take 'Scene' (importing back as 'Armature|Scene'), so clips collide + # in any take-addressed bank (Unreal/3GOD). Rename the scene; keep the armature 'Armature' so the + # imported action reads '|' — the same shape Mixamo's anim-only FBXs use. + bpy.context.scene.name = name target.animation_data.action.name = name export_fbx(target, fbx) # sanity: the FBX action must carry keys on the driven bones