an.stage#

The 2D stage: the default engine, shipped with an but outside the core (an#247).

ADR 0001 decisions 5, 9 and 14; core study §5. The stage is a keyframed 2D scene-graph player – runtime.js (PixiJS) in headless Chromium, its JSON wire contract, and what it draws for every genre: stroked paths, text, raster and SVG art, planes with parallax, props, the camera, surface treatments. It is ONE engine among several (Manim draws explainer shots, previz engines draw view states), so the core never imports it: the renderer registry names it by module and imports it on first use (an.adapters.register_lazy_renderer). Its optional dependency (Playwright) is the an[stage] extra.

Every old path (an.adapters.cutout.render, an.paths, …) is a live alias. This __init__ imports nothing, so importing one stage module does not load the others.

Module Attributes

STAGE_RENDERER_NAMES

the persisted cutout and the engine's own stage (ADR 0001 decision 9).

Functions

draws_on_stage(shot)

Whether shot is drawn on the stage, so it has a compiled stage document an can read (positions, timelines): THE rule, read off the shot's renderer selector (the names the stage's renderer claims).

an.stage.STAGE_RENDERER_NAMES: tuple[str, ...] = ('cutout', 'stage')#

the persisted cutout and the engine’s own stage (ADR 0001 decision 9). The ONE copy.

Type:

The Shot.renderer values the stage draws

an.stage.draws_on_stage(shot)[source]#

Whether shot is drawn on the stage, so it has a compiled stage document an can read (positions, timelines): THE rule, read off the shot’s renderer selector (the names the stage’s renderer claims). A Manim shot is not.

>>> from types import SimpleNamespace as NS
>>> draws_on_stage(NS(renderer="cutout")), draws_on_stage(NS(renderer="manim"))
(True, False)
Return type:

bool

Modules

cache_key

What a cut-out shot render reads: the keyer behind its shot-cache key (ADR 0004).

canvas_capture

The canvas capture path: frames read from the page, not photographed off the screen.

compile

Compile a top-level Shot (renderer="cutout") into a CutoutSceneJSON.

counters

A counter, lowered at compile: a number that reads as text (an#342, T2 of an#331).

easing

The stage engine's easing vocabulary — a view of an.timing.easing.

environments

Environments: a stage made of planes, at declared depths.

fidelity

How faithfully a compiled scene reproduces the art it was built from.

gradients

Gradient fills on the stage: a Gradient drawn as an inline SVG texture.

hold

The hold layer: what carries each item, frame by frame, and the hands that move it (an#502, catalogue A4).

mirror_states

Mirror states (an#819): the drawing art uses when it is drawn mirrored.

path_geometry

Stroked-path geometry — the executable spec of runtime.js::pathGeometry.

path_wobble

A hand-drawn wobble for stroked paths, applied at compile time (an#161).

paths

Stroked paths: routes, invasion arrows, borders, timelines, connectors.

preview

Live preview server: render a project's current scene in a browser, reloading on edit.

prop_validate

Check a prop's asset folder offline, and say what a prop must be (an#340).

props

Props: a rig whose art is not a person.

raster

Raster art: what a PNG, JPEG or WebP is, read from its header (an#211).

render

The 2D stage engine (runtime.js in headless Chromium), and the cut-out renderer built on it.

rig

The rig model the stage draws: bones, slots, skins and attachments.

rigid

Rigid falls in the stage plane: a let-go item's flight, landing, tip and bounce; a body toppling about a contact.

runtime

Cutout JS runtime — see README.md in this directory.

runtime_files

Locate the bundled cutout JS runtime files.

serialize

JSON contract between the Python compiler and the (future) JS runtime.

shadow

Contact shadows: an ellipse where a supported member meets its surface (an#519 rank 16, catalogue D2).

snapshot

Rasterise art files to PNG in the browser the stage already uses (an#347).

solve

The solve compile pass: joints kept at every frame (ADR 0008 decision 6, an#512).

support

Supports: what a body rests on, and how far it is from resting there (an#519, catalogue A1).

surface

Surface treatments, compiled (an#163 gap 5): outline, paper-gap shadow, glow, grain.

surface_line

Surface lines: what a thing stands on, as a line on the stage (an#519).

text

Words on screen: title cards, labels, and text you can animate word by word.

text_layout

A text block, compiled: one node per unit, each an SVG sprite (an#155).

timeline

Stage timeline helpers: the compiled scene as a Timeline, and screen space.

topple

The topple compile pass: rigid bodies falling over, one knocking the next (an.ir.topple).

tree

The scene tree's paths: the ONE Python statement of how runtime.js indexes nodes (an#343).

world

The stage's side of the scene world (ADR 0009): measuring a member's extent, and lowering a whole scene for the compiler.