Skip to content

@modoki/engine / index / SkeletalAnimator

Variable: SkeletalAnimator

const SkeletalAnimator: Trait<{ activeClip: string; animSet: string; clip: string; effectivePaused: boolean; fadeDuration: number; loop: boolean; normalizedTime: number; playing: boolean; speed: number; time: number; weight: number; }>

SkeletalAnimator — desired playback state for a SkinnedModel's GLB clips.

Pure DATA. The render sync (scene3DSync.syncSkinnedModels) owns the actual THREE.AnimationMixer / AnimationActions and reads this trait each frame to drive them — the same split used for Renderable3D material binding. Put this on the SAME entity as the SkinnedModel.

  • animSet — ref (GUID) to a .animset.json providing per-CLIP default params (speed/loop/fadeDuration). Empty → no animset (legacy: the fields below are used directly). When set, speed/loop/fadeDuration act as per-entity OVERRIDES: a field left at its trait default below inherits the animset's per-clip value; a non-default value wins. (The defaults here MUST match ANIMSET_DEFAULTS in animSetCache — that equality IS the sentinel.)
  • clip — active clip NAME (as authored in the GLB). Empty → first clip.
  • playing — false pauses the mixer (pose holds).
  • speed — playback rate (mixer timeScale); 1 = authored, negative = reverse.
  • loop — repeat vs. play-once-and-clamp.
  • fadeDuration — crossfade seconds when clip changes (0 = instant switch).

Built with Modoki.