Skip to content
Shapemetry

@huukhanhnguyen/types / evaluate/animation

evaluate/animation

AnimationClip

AnimationClip = { name: string; tracks: string[]; }

A named GROUP of tracks — the export/selection unit ("Walk", "Run", "Idle"). Every format that round-trips a real animation clip requires one: Blender's Action, Unity's AnimationClip, Unreal's AnimSequence, FBX's AnimStack, glTF/USD's named animation — measured 2026-08-14: a clip with no shared anchor for its member tracks is a real, filed interop bug (github.com/KhronosGroup/glTF#569 — mismatched per-track length with no clip-level tie, ~1.79s desync per loop between two implementations' guesses). Membership is BY REFERENCE (track keys), not containment — a track stays independently addressable (a parameter can point at one directly) whether or not it is also a clip member.

name

name: string

tracks

tracks: string[]

Member track keys, in authoring order.


Track

Track = { interpolation?: "LINEAR" | "STEP"; key: string; times: number[]; values: number[][]; }

One keyframe track — pure value-over-time data, nothing else. key is unique across the WHOLE model (not just within its enclosing AnimationClip, if any) — a reference to a track never needs to know which clip (if any) it lives in.

values[i] is the value at times[i] — an array whose OWN length is however many numbers that keyframe carries (3 for a position, 4 for a rotation quaternion, N for a mesh's whole morph-weights array at once — glTF packs every morph target of one node into a single weights channel, so one track already covers all of them).

interpolation?

optional interpolation?: "LINEAR" | "STEP"

LINEAR when absent. STEP holds the previous key's value.

key

key: string

times

times: number[]

values

values: number[][]

Last updated: 📖 2 min readEdit on GitHub