Introducing Animation Retargeting — Give Any Animation to Any Character!
Hey Babylon.js community! ![]()
We are thrilled to announce a brand-new feature landing in Babylon.js v9.0: Animation Retargeting! This is something many of you have been asking for, and it’s finally here — fully integrated and ready to use.
What is animation retargeting?
In a nutshell: take an animation made for one character and apply it to a completely different character. Different skeleton, different proportions, different bone naming — no problem! No more authoring unique animations for every character in your scene. One walk cycle, one combat combo, one dance → works on all of them. ![]()
The interactive Retargeting Tool
The best way to get started is the Animation Retargeting Tool — an interactive playground that requires zero code.
The tool gives you a split viewport — your target character on the left, the source animation skeleton on the right — plus a full control panel:
- Built-in characters and animations to experiment with right away
- Bone Gizmos to interactively adjust the rest pose of both the avatar and the source animation in-browser, to align skeletons before retargeting
- All
IRetargetOptionsexposed as checkboxes and dropdowns - A Console that shows any bone-matching warnings after retargeting
- An Export to Playground button that generates a standalone, ready-to-run code snippet capturing your exact setup — including all gizmo adjustments and bone name remappings!
The API
Prefer to work in code? The new AnimatorAvatar class exposes retargetAnimationGroup():
const avatar = new BABYLON.AnimatorAvatar("hero", heroRootNode);
const retargeted = avatar.retargetAnimationGroup(sourceGroup, {
animationGroupName: "hero_walk",
fixRootPosition: true,
fixGroundReference: true,
rootNodeName: "Hips",
groundReferenceNodeName: "LeftFoot",
mapNodeNames: new Map([
["mixamorig:Hips", "Hips"],
["mixamorig:LeftFoot", "LeftFoot"],
["mixamorig:RightFoot", "RightFoot"],
]),
});
retargeted.play(true);
Under the hood the system does several smart things automatically:
- Name-based bone matching — with an optional
mapNodeNamestable for rigs that use different conventions (like Mixamo’smixamorig:prefix) - Keyframe transform compensation — mathematically remaps each keyframe from the source bone’s reference frame into the target bone’s frame, so world-space motion is preserved
- Root position scaling — scales root displacement proportionally so a shorter character doesn’t slide and a taller one doesn’t take tiny steps
- Ground reference correction — keeps feet planted; includes a dynamic mode that handles any bone temporarily dipping lower than the reference bone (e.g. during a kick or crouch)
- Morph target support — facial and shape-key animations retarget too!
See it in action
Live demo — a hip-hop animation retargeted onto a character: playground #K1QFZD#2
Full documentation
A big thank you to everyone who contributed ideas and feedback! We can’t wait to see the characters and animation libraries you’ll build with this. Drop your questions, feedback, and cool demos right here — we’re all ears! ![]()
(post written by AI)