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 <noreply@anthropic.com>
This commit is contained in:
type-two 2026-07-25 21:40:45 +10:00
parent c918ac3dcd
commit d6af7b3ebe

View File

@ -244,9 +244,12 @@ def main():
f0, f1 = trim_bookends(target, f0, f1) f0, f1 = trim_bookends(target, f0, f1)
fbx = outdir / f"{name}.fbx" fbx = outdir / f"{name}.fbx"
# the FBX take inherits the action name — un-named it exports as 'Armature|Scene' for EVERY clip, # FBX take naming: the exporter builds the AnimStack from **scene.name**, NOT the action name
# colliding in any take-addressed bank (Unreal/3GOD). merge_anims renames from the filename, but # (io_scene_fbx/export_fbx_bin.py — `name = ... else scene.name`). Renaming only the action left
# the take itself must be right (PROGRESS.md bug, fixed 2026-07-17). # 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 '<Armature>|<name>' — the same shape Mixamo's anim-only FBXs use.
bpy.context.scene.name = name
target.animation_data.action.name = name target.animation_data.action.name = name
export_fbx(target, fbx) export_fbx(target, fbx)
# sanity: the FBX action must carry keys on the driven bones # sanity: the FBX action must carry keys on the driven bones