Introduction

A generator-driven actor runtime for deterministic, frame-based video. Author motion once as code; resolve any frame as a pure function.

MotionActor is the runtime behind frame-accurate video built in TypeScript. You write a scene as a generator, the runtime records what you authored, and any frame resolves as a pure function of that record.

const compiled = createScene(function* (ctx) {
  const card = ctx.spawn(Card);

  yield* card.appearance.opacity.tween(1, 0.3);
  yield* ctx.wait(0.5);
  yield* card.layout.x.tween(200, 0.5);

  return { card };
});

compiled.at(45).scene.card.layout.x; // 200 — no playback, no side effects

Two things follow from that shape, and most of this documentation is downstream of them.

Authoring is sequential; resolution is random-access. The generator reads like a storyboard — do this, wait, then do that — but nothing plays. yield* advances an authored cursor and records the tween. Rendering frame 45 never replays frames 0–44.

Frames are pure. at(frame) depends on the frame, the channel values it reads, and the options you pass. Nothing else. That is what makes seeking, caching, headless evaluation and reproducible renders possible — and it is why Date.now() and Math.random() inside a derived body are unsupported rather than merely discouraged.

Start here

Authored time is in seconds

Every authored duration in this documentation is seconds. The runtime converts to integer frames using the scene's fps, so the same scene at 30 and 60 fps produces the same motion at different frame counts.

card.appearance.opacity.tween(1, 0.3)
9f
ctx.wait(0.5)
15f
card.layout.x.tween(200, 0.5)
15f
30 fps
0s·0f
1s·30f
2s·60f
3s·90f

Three sequential yield*s become 39 frames of authored time. compiled.totalDuration reports 39; frame 45 is past the end, so the card sits at its final x of 200.

What this site covers

This is the runtime reference: the scene model, the state primitives, the hosting model, and the core actor surfaces. Reusable actor families and the component registry live in motionactor-library and are documented alongside it.

Editorial rule

Only the stable core surface is documented here. Demo-specific actors, large family catalogs and unsettled design notes belong elsewhere.

On this page