MotionScript

@motion-script/core


@motion-script/core / ScenePrecomp

Interface: ScenePrecomp

Defined in: runtime/precompisition.ts:69

Everything learned from running one scene's generator to completion, in scene-local terms (frame 0 = the scene's first frame).

Scenes are independent units — they no longer compose — so each scene's pass is fully self-contained: its frame count, its own asset usage, its audio, and its node lifespans are all scene-local. The only place a scene's global position enters is startFrame, recomputed cheaply when an upstream scene's duration changes (see assembleTimeline). This is what makes a single scene re-runnable in isolation for hot reloading.

Properties

assetRecords

assetRecords: ReadonlyMap<string, AssetRecord>

Defined in: runtime/precompisition.ts:92

This scene's own asset usage, in scene-local frames (records carry startFrame/endFrame relative to the scene). Merged and shifted into the global asset map by assembleTimeline. Keyed by stable asset key (src for images/videos, family for fonts).


audioRequests

audioRequests: AudioRequest[]

Defined in: runtime/precompisition.ts:85

Audio requests emitted by this scene's nodes, with scene-relative timing.


frameCount

frameCount: number

Defined in: runtime/precompisition.ts:81

Frame count for this scene.


lifespans

lifespans: Map<string, NodeLifespan>

Defined in: runtime/precompisition.ts:101

Per-node lifespan within this scene, in scene-local frames. Keyed by the node's structural path (child-index path from the scene root, e.g. "0.2.1") rather than its id: ids are per-instance UUIDs that change when a scene is rebuilt, but the build is deterministic so the structural path is stable between the precomp pass and playback. A node added or removed partway through a scene gets a range narrower than the scene's duration.


measured

measured: boolean

Defined in: runtime/precompisition.ts:79

Whether this scene's generator has actually been driven yet.

Precomp.runAsync publishes intermediate results in which scenes it hasn't reached appear as zero-length placeholders, so downstream frame arithmetic stays valid while the timeline is still growing. This flag is the only way to tell such a placeholder from a scene that genuinely measured zero frames — don't infer it from frameCount.


startFrame

startFrame: number

Defined in: runtime/precompisition.ts:83

Absolute frame offset of this scene in the global timeline.