FERRETGame engine over Babylon.js
Ferret

Animation graphs

Skill ferret-animation · download all skills · SKILL.md

When to use#

Making a character animate, adding a one-shot action, moving clips between skeletons, or testing with a stand-in body.

The model#

An Animator plays a GraphDef on an entity: state machines, 1D/2D blend spaces driven by speed or direction, layers, Montages for one-shot actions, and notifies at named times in a clip. The graph does not use Babylon's animation clock: poses are requested and applied each fixed step, so animation is deterministic with the world.

Steps#

  1. Start from locomotionGraph (walk / run / jump) or write a GraphDef and check it with validateGraphDef.
  2. Bind clips to a skeleton with bindClips; retargetGroup moves a clip from one skeleton to another.
  3. No real model yet: buildPuppet makes a stand-in skinned character.
  4. One-shots (attack, wave): a Montage; react to notifies for footsteps and hits.
  5. Graphs can live in the level manifest (animGraphs) and be edited by commands (anim.*, edit.anim.*).

Check afterwards#

anim.list, anim.graph, anim.play, anim.scrub show the state; every transition target and initial state exists; a retargeted clip moves the bones.

What usually goes wrong#

  • A transition to a removed state (the editor refuses removing a state still used).
  • Clips whose bones the target body does not have: they are noted in the report, not errors; check the clip really moves something.
  • Driving animation from onUpdate timing instead of the graph's own step.

Files#