PanduanDeep dive4 menit baca

How afk.ai works: One AI model that retargets any rig

The neural network we trained to take any rigged model and any animations, and return the model performing all of them on its own skeleton.

Input rig

character.fbx

skeleton and skinned mesh, any bone names

Input animations

Any clips

  • Walk
  • Run
  • Jump
  • Sword Combo
  • Dance
  • …

keyframed or motion capture, on any skeleton

afk.ai retargeting modelAI

  1. 1

    Rig encoder

  2. 2

    Motion encoder

  3. 3

    Attention decoder

character.glb

your model, every clip on its own bones

Animation retargeting means playing an animation made for one skeleton on another. It's hard because no two rigs agree: bone counts, names, proportions and rest poses all differ. Copy the rotations across and feet slide, hands miss what they reach for, and arms pass through the body.

afk.ai does it with one neural network we trained for the job. It takes a rigged model and a set of animations, and returns the model performing every animation on its own bones. There's no bone mapping to set up and no naming convention to follow. The model works out which of your bones does what, and how each motion should look on your character's body.

What goes in and what comes out

The model has two inputs and one output:

Nothing about your rig changes. The skeleton, bone names, skin weights and mesh come out exactly as they went in, with the new animations added.

Input rig
Your model's skeleton (its joints, hierarchy and rest pose) and its skinned mesh, from a GLB, FBX or VRM file.
Input animations
Clips made on any skeleton, whether keyframed or motion capture.
Output
Your model with each clip baked as keyframes onto its own bones.

Reading the rig as a graph

The model doesn't read bone names. Bone.017, mixamorig:LeftLeg and calf_l mean nothing to it. Instead, it reads the skeleton as a graph, where each joint is a token described by geometry:

  • where it sits relative to its parent in the rest pose, scaled to the character's height
  • how deep it is in the hierarchy, and how many children it has
  • the part of the mesh it moves, taken from the skin weights

A graph transformer passes information along the bones, so each joint's embedding comes to know its place in the body: the middle of a three-joint chain, below the hips, on the left. That's a knee, whatever it's called. The same goes for rigs that look nothing alike: five spine joints or two, a tail, wings, or no fingers at all.

joint token · left knee
  • offset from parent(-0.02, -0.26, 0.01)
  • depth in the tree2
  • children1
  • mesh it moves128 points
  • bone nameBone.017
Drawn: the model reads a skeleton as a graph. Each joint is a token of geometry: where it sits, how it connects, and the part of the mesh it moves. Its name isn't used.

Inside the model

The model has three parts:

  1. Rig encoder. It turns both skeletons, the animation's and yours, into joint embeddings.
  2. Motion encoder. It reads the animation frame by frame: each joint's rotation in a continuous 6D form, plus the root's velocity and which feet are touching the ground. It encodes what the motion is doing rather than its raw rotations.
  3. Attention decoder. For every frame, each of your joints attends to the animation's joints and picks up the motion it should follow. The decoder then writes a rotation for every one of your joints, plus a root path scaled to your character's stride.

The attention replaces the bone map a retargeting tool would ask you for. It's learned, soft and per frame. Three spine joints can share the motion of two, and a joint with no counterpart, like a tail on a humanoid's animation, gets secondary motion that follows the body.

Cross-attention, one frameAI

yours ↓ / source →HipsSpineChestNeckHead
pelvis0.920.06···
spine_a0.220.720.06··
spine_b0.020.480.480.02·
spine_c·0.080.860.06·
neck··0.100.840.06
head···0.080.92
tail_10.340.120.02··
tail_20.180.06···
Drawn: one frame's attention from your joints to the animation's. Three spine joints share the source's two, and the tail, which the source doesn't have, follows the hips loosely and gets motion of its own.

How we trained it

No dataset shows what a given dance should look like on a given character, so the model learns without one. It trains on a large collection of rigged characters and animations, and checks its own results against itself and against physics:

  • Reconstruction: a clip retargeted onto its own rig must come out unchanged.
  • Cycle: a clip taken from rig A to rig B and back must match the original.
  • Hands and feet: where they reach, relative to the body and scaled to the limbs, must match the source.
  • Contacts: a foot planted in the source stays planted, with no sliding.
  • No clipping: the character's own skinned mesh is checked each frame, and limbs passing through the body are penalized.
  • Natural motion: a critic trained on real motion pushes the results to look like movement, not math.

During training, every character is also seen with its bones stretched and shortened, its joints split and merged, its rest pose switched between a T-pose and an A-pose, and its bones renamed at random. That's why the model generalizes to rigs it has never seen.

Clip on rig A

Same clip on rig B

Back on rig A

↺ must come back as the original

  • Reconstruction

    A clip put on its own rig comes out unchanged.

  • Cycle

    A to B and back to A returns the original.

  • Hands and feet

    Where they reach, scaled to the limbs, matches the source.

  • Contacts

    A planted foot stays planted, with no sliding.

  • No clipping

    Limbs that pass through the mesh are penalized.

  • Natural motion

    A critic trained on real motion flags anything that isn't.

one character, as training sees it

Drawn: there's no right answer to copy for a clip on a new character, so training checks the model against itself and against physics, on characters it sees stretched, squashed and re-jointed.

Running it on your model

When you upload a rigged model, its rig is encoded once and cached. Every animation then runs through the decoder in one batch on the GPU, so the whole library is retargeted at once, and a clip added later takes one more pass.

A light clean-up follows: rotations are kept continuous from frame to frame, and feet the model marked as planted are locked in place. The results are baked as keyframes onto your bones and written to one GLB, which plays in Blender, Unity, Unreal Engine or any glTF viewer.

  1. 1Encode the rigAI

    Once per model, cached.

  2. 2Retarget every clipAI

    Batched on the GPU, all at once.

  3. 3Clean up

    Smooth rotations, lock planted feet.

  4. 4Bake and export

    Keyframes on your bones, in one GLB.

character.glb
meshes  └ Body, Hair, Clothes  your vertices, materials and texturesskins[0]  your skin weights, unchanged  └ Bone.001 … Bone.064  your skeleton, names and allanimations  └ Idle  one the model came with  └ Walk, Run, Jump …  every clip, on your bones
Drawn: what happens to your model, and what's in the GLB you download. In blue, what the model added.

Questions

Do my bones need to follow a naming convention?

No. The model never reads bone names, only the shape of the skeleton and the mesh it moves. A rig named Bone.001 to Bone.064 works the same as a Mixamo one.

What if my rig has extra bones?

Bones the animation doesn't have, such as a tail, ears, a cape or hair, get motion that follows the body. Bones your rig doesn't have are simply left out.

Does it work on animals and creatures?

Yes. A skeleton is a graph to the model, whatever it's shaped like. The same model retargets humanoids, four-legged animals, birds and creatures, as long as the animation was made for a similar body.

Why not just copy the rotations?

Because rotations only mean the same thing on skeletons with the same rest pose and proportions. On a character with longer legs or an A-pose, copied rotations make feet slide, hands miss and arms clip through the body. The model retargets what the motion does, not the numbers it was stored as.

Will my rig be changed?

No. Your skeleton, bone names, skin weights and mesh come out exactly as they went in. The only thing added is the animations.

Rig dan animasikan model Anda

AI me-rig model Anda di browser, lalu ratusan animasi bisa diputar di model itu. Unduh satu GLB untuk engine apa pun.

Rig model

Panduan lainnya