# 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

- **Space:** game-assets-and-ai-public (https://github.com/Tech-Realm/space-game-assets-and-ai-public/tree/main/animation-retargeting)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** blender, python3
- **Routes:** local-blender; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use game-assets-and-ai-public/animation-retargeting` or MCP `get_pack game-assets-and-ai-public/animation-retargeting`
- **Files:** CHANGELOG.md, code/retarget.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (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.



---

Canonical URL: https://logicpacks.io/packs/game-assets-and-ai-public/animation-retargeting

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
