Skip to content
Shapemetry

Model - animations[]

Every method of the animations[] lane. Each step of a animations[] entry returns a animation, and the lane's entries are addressed by the identity schema/lanes.ts declares for it.

MethodDescriptionArgTypeDefaultMeaning
formulaTrackFormula track — A track carrying 1 number per keyframe, authored as a formula of time rather than hand-placed keyframes — baked (sampled) into a plain keyframe track at evaluate time. Drives a numeric parameter's animation. Same grammar as curveFunction's point arg: an arrow-function expression, the engine's own AST (never eval/Function()).formulastring'(t) => t'Arrow-function expression '(t) => number', t in seconds.
durationnumber1Seconds — a formula has no self-describing end, unlike a keyframe array's last entry.
interpolationstring'LINEAR''LINEAR' | 'STEP' — how the BAKED samples interpolate between each other.
numberTrackNumber track — A track carrying 1 number per keyframe — a scalar channel: a numeric parameter's animation, or any single value over time. Keyframes authored directly — times + one value array per keyframe (hand-placed, or baked mocap/GLB import).timesobject[0,1]Keyframe times in seconds, ascending.
valuesobject[[0],[1]]One 1-number array per keyframe, e.g. [[0],[90]].
durationnumberSeconds. Omit = times[times.length-1] (an explicit longer duration authors a hold before looping).
interpolationstring'LINEAR''LINEAR' | 'STEP'.
quaternionTrackQuaternion track — A track carrying 4 numbers per keyframe [x,y,z,w] — a skeleton joint's rotationTrack. Keyframes authored directly — times + one value array per keyframe (hand-placed, or baked mocap/GLB import).timesobject[0,1]Keyframe times in seconds, ascending.
valuesobject[[0,0,0,1],[0,0,0,1]]One 4-number quaternion array per keyframe, e.g. [[0,0,0,1],[0,0,0.707,0.707]].
durationnumberSeconds. Omit = times[times.length-1] (an explicit longer duration authors a hold before looping).
interpolationstring'LINEAR''LINEAR' | 'STEP'.
vectorTrackVector track — A track carrying 3 numbers per keyframe [x,y,z] — a skeleton joint's positionTrack or scaleTrack. Keyframes authored directly — times + one value array per keyframe (hand-placed, or baked mocap/GLB import).timesobject[0,1]Keyframe times in seconds, ascending.
valuesobject[[0,0,0],[0,0,1]]One 3-number array per keyframe, e.g. [[0,0,0],[0,0,100]] (model length for a position, factors for a scale).
durationnumberSeconds. Omit = times[times.length-1] (an explicit longer duration authors a hold before looping).
interpolationstring'LINEAR''LINEAR' | 'STEP'.
weightsTrackWeights track — A track carrying N numbers per keyframe, one per morph target — a mesh's morph-target weights. Keyframes authored directly — times + one value array per keyframe (hand-placed, or baked mocap/GLB import).timesobject[0,1]Keyframe times in seconds, ascending.
valuesobject[[0],[1]]One array per keyframe, every array as long as the mesh's morph-target list, e.g. [[0,0],[1,0]].
durationnumberSeconds. Omit = times[times.length-1] (an explicit longer duration authors a hold before looping).
interpolationstring'LINEAR''LINEAR' | 'STEP'.
Last updated: 📖 2 min readEdit on GitHub