@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) →applyClipAtTimewrites 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) thatscene3DSync.syncSkinnedModelsconsumes, posing the mixer toaction.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
t
number
index?
clearSeeks?
boolean = true
Returns
void