Skip to content

Packs / game-assets-and-ai-public

animation-retargeting

Retarget an animation from one armature to another in Blender headless (bone-name map, bake, pose verified at mid-clip) and export an animated, skinned GLB

Install

logicpacks pack use game-assets-and-ai-public/animation-retargeting
get_pack game-assets-and-ai-public/animation-retargeting

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: local-blender
  • Checks: 1 in outcome/checks.yaml
  • Code: retarget.py
  • Tools: blender, python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Goal

Mocap or library animations (e.g. Mixamo-style rigs) play on our character rig, baked so the GLB has no constraints, verified numerically.

Steps

  1. Import source animation and target rig into one .blend (FBX import for Mixamo).
  2. If bone names differ, write a map JSON {"target_bone": "source_bone"} (e.g. mixamorig:Spine -> spine).
  3. Run blender -b rig.blend --python code/retarget.py -- out.glb --src SourceArmature --tgt OurRig --map map.json.
  4. It adds Copy Rotation constraints (local space), bakes visual keys over the scene range, removes constraints, checks the mid-frame pose error, deletes the source and exports.
  5. Gate: python3 ../tools/glbtool.py inspect out.glb --need-anim --need-skin.

Edge cases

  • Different rest poses (A-pose vs T-pose): fix the rest pose first or rotations come out offset.
  • Root motion: copy location on the root/hips only, scaled by leg-length ratio.

Don'ts

  • Don't retarget onto rigs with different bone roll without checking a mid-frame pose.
  • Don't ship Mixamo animations outside the terms of Adobe's licence.