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.
an.stage.render–StageEngineand the renderer, which claims bothstageand the persistedcutout;an.stage.compile– shot -> compiled document, as ordered compile passes (an.stage.passes); genres register theirs;an.stage.serialize– the wire contract (field names unchanged);an.stage.timeline– the compiled document’s evaluation and screen space;drawables:
paths,text,raster,environments,props;path_geometry,text_layout,surface;an.stage.preview(live preview),an.stage.fidelity,an.stage.canvas_capture,an.stage.runtime_filesand the bundledruntime under
an/stage/runtime/.
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
the persisted |
Functions
|
Whether |
- an.stage.STAGE_RENDERER_NAMES: tuple[str, ...] = ('cutout', 'stage')#
the persisted
cutoutand the engine’s ownstage(ADR 0001 decision 9). The ONE copy.- Type:
The
Shot.renderervalues the stage draws
- an.stage.draws_on_stage(shot)[source]#
Whether
shotis drawn on the stage, so it has a compiled stage document an can read (positions, timelines): THE rule, read off the shot’srendererselector (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:
Modules
What a cut-out shot render reads: the keyer behind its shot-cache key (ADR 0004). |
|
The canvas capture path: frames read from the page, not photographed off the screen. |
|
Compile a top-level |
|
A counter, lowered at compile: a number that reads as text (an#342, T2 of an#331). |
|
The stage engine's easing vocabulary — a view of |
|
Environments: a stage made of planes, at declared depths. |
|
How faithfully a compiled scene reproduces the art it was built from. |
|
Gradient fills on the stage: a |
|
The hold layer: what carries each item, frame by frame, and the hands that move it (an#502, catalogue A4). |
|
Mirror states (an#819): the drawing art uses when it is drawn mirrored. |
|
Stroked-path geometry — the executable spec of |
|
A hand-drawn wobble for stroked paths, applied at compile time (an#161). |
|
Stroked paths: routes, invasion arrows, borders, timelines, connectors. |
|
Live preview server: render a project's current scene in a browser, reloading on edit. |
|
Check a prop's asset folder offline, and say what a prop must be (an#340). |
|
Props: a rig whose art is not a person. |
|
Raster art: what a PNG, JPEG or WebP is, read from its header (an#211). |
|
The 2D stage engine ( |
|
The rig model the stage draws: bones, slots, skins and attachments. |
|
Rigid falls in the stage plane: a let-go item's flight, landing, tip and bounce; a body toppling about a contact. |
|
Cutout JS runtime — see README.md in this directory. |
|
Locate the bundled cutout JS runtime files. |
|
JSON contract between the Python compiler and the (future) JS runtime. |
|
Contact shadows: an ellipse where a supported member meets its surface (an#519 rank 16, catalogue D2). |
|
Rasterise art files to PNG in the browser the stage already uses (an#347). |
|
The |
|
Supports: what a body rests on, and how far it is from resting there (an#519, catalogue A1). |
|
Surface treatments, compiled (an#163 gap 5): outline, paper-gap shadow, glow, grain. |
|
Surface lines: what a thing stands on, as a line on the stage (an#519). |
|
Words on screen: title cards, labels, and text you can animate word by word. |
|
A text block, compiled: one node per unit, each an SVG sprite (an#155). |
|
Stage timeline helpers: the compiled scene as a |
|
The |
|
The scene tree's paths: the ONE Python statement of how |
|
The stage's side of the scene world (ADR 0009): measuring a member's extent, and lowering a whole scene for the compiler. |