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#
- Start from
locomotionGraph(walk / run / jump) or write aGraphDefand check it withvalidateGraphDef. - Bind clips to a skeleton with
bindClips;retargetGroupmoves a clip from one skeleton to another. - No real model yet:
buildPuppetmakes a stand-in skinned character. - One-shots (attack, wave): a
Montage; react to notifies for footsteps and hits. - 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
onUpdatetiming instead of the graph's own step.
Files#
reference/packages.md— Characters, animation graphs, NPC navigation, interactables, zones and transformations.reference/api-animation.md— every export of@ferret/animationwith signature and doc comment