Skip to content

@modoki/engine / index / previewTimelineAt

Function: previewTimelineAt()

previewTimelineAt(world, rootId, def, t, index?, clearSeeks?): void

Editor scrub-preview: pose STATE (applyTimelineState — Animator fields + activation) AND additionally SAMPLE each animation clip to an exact frame, so a STOPPED SceneView shows the pose. The runtime relies on animationSystem / the skeletal mixer to sample, both sim-gated off while stopped — this fills that gap for the editor. No edge events fire (idempotent).

Two animator flavours, sampled two ways:

  • keyframe Animator (2D deform / scalar) → applyClipAtTime writes the exact pose here.
  • 3D SkeletalAnimator → its pose lives in a THREE mixer the render layer owns, so we can't sample it here; instead publish a SEEK request (requestSkeletalSeek) that scene3DSync.syncSkinnedModels consumes, posing the mixer to action.time = localT. Seeks are cleared + rebuilt every scrub so a scrub before the first clip (no active block) leaves the rig un-seeked. (Sprite/flipbook animators remain trigger-only — no arbitrary seek.)

Parameters

world

World

rootId

number

def

TimelineDef

t

number

index?

EntityIndex

clearSeeks?

boolean = true

Returns

void

Built with Modoki.