Frame
One rendered moment: every entity's state at a single instant, plus the
Interface: Frame<Resources>
Defined in: packages/motion/src/Scene.ts:332
One rendered moment: every entity's state at a single instant, plus the metadata needed to draw it.
Remarks
A frame is self-describing — it carries its own resolution, background, frame rate, and camera view, so a renderer needs nothing but the frame to produce a picture. That is what lets frames be serialized, cached, or sent to a different process.
instances is keyed by instance id and holds plain data, not handles. The
active camera is deliberately absent from it (it is view state, surfaced
as camera instead), and root names the group everything hangs from,
which is never itself drawn.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
Resources | never | Fonts and images the renderer will need; frames carry the requirement, never the bytes. |
Properties
~resources?
readonly optional ~resources?: Resources;Defined in: packages/motion/src/Scene.ts:338
phantom: the loader requirements the renderer will demand for this frame. Never a runtime value — an unused type parameter would be structurally erased, so it must anchor on an (always-absent) field.
backgroundColor
backgroundColor: Color;Defined in: packages/motion/src/Scene.ts:347
camera
camera: CameraView & PointOfInterest;Defined in: packages/motion/src/Scene.ts:349
the active camera's view; the resting view when unused
comps
comps: Record<string, CompFrame>;Defined in: packages/motion/src/Scene.ts:356
Mounted scenes (Scene.play), keyed by the id of the group they mount
under. Each is a render-to-texture boundary: the renderer draws the
subtree to its own target at these bounds, through the child's own
camera, and composites the result. An id absent here is a plain group.
frameRate
frameRate: number;Defined in: packages/motion/src/Scene.ts:344
render metadata — frameRate from the runner settings, resolution and background from the ROOT scene's comp config; a frame is self-describing
height
height: number;Defined in: packages/motion/src/Scene.ts:346
instances
instances: Record<string, FrameEntry>;Defined in: packages/motion/src/Scene.ts:339
masks?
optional masks?: Record<string, MaskAttachment>;Defined in: packages/motion/src/Scene.ts:358
Plain target-id to source-id references. Absent on older serialized frames.
root
root: string;Defined in: packages/motion/src/Scene.ts:341
id of the root group (conventionally "root"); never rendered itself
width
width: number;Defined in: packages/motion/src/Scene.ts:345