an.stage.world#
The stage’s side of the scene world (ADR 0009): measuring a member’s extent, and lowering a whole scene for the compiler.
The IR layer (an.ir.world) projects points and sizes; what it cannot
know is how big an entity’s art is. This module measures that the way the
runtime would draw it, without a browser: it compiles the entity’s specimen
shot alone and takes the union of its nodes’ boxes
(an.stage.timeline.node_box(), an#445), relative to the entity’s own
placement point. Any registered entity kind with a specimen is measured
the same way, so a genre’s rig and the core’s props get one rule.
lower_scene() is the one call the pipeline’s entry points make
(an render, an preview, an probe, an validate, the orchestrator):
extents, film starts, then an.ir.world.lower_world().
Functions
|
|
|
|
|
The lowered scene, or |
|
|
|
The box |
|
What |
- an.stage.world.lower_scene(scene, mall, *, fps=None, film_starts=None, project_dir=None, continues=True)[source]#
sceneas the compiler should see it: every framed shot’s placements derived from the world (an.ir.world.lower_world()), with the members’ extents measured here and each shot’s film start from the assembled timeline (so a travel’s streams keep phase across cuts). A scene without a world comes back as it is, at no cost. Then every shot’scontinue:is resolved (an.continuity.continue_shots(), an#542): a shot that continues another opens as that one ends (project_dir: where a sibling scene file is read; default the mall’s;continues: off for the world alone, asan validatereports the two apart).Raises
an.ir.world.WorldErrorfor a viewpoint that cannot be resolved;an validatereports the same error instead of raising.>>> lower_scene(SceneIR(), {}).scene.timeline []
- Return type:
- an.stage.world.lowered_or_same(scene, mall, *, fps=None)[source]#
The lowered scene, or
sceneitself when it has no world or its world cannot be lowered: for the walks that must see what a framed shot draws (credits, publishability) but are not where a world error is reported (validate is).- Return type:
- an.stage.world.member_extents(world, mall, *, width, height, problems=None)[source]#
{id: native box}for every positioned or attached member and every stream ofworld(environments draw plates, not a box, and are left out). A member whose art cannot be measured maps toNone— a missing ref, an unregistered kind, a compile that refuses — andproblems(an out-parameter, like the compiler’stextures) records why, so the lowering can say it instead of a traceback (ADR 0009: validate reports).
- an.stage.world.native_box(ref, mall, *, width, height)[source]#
The box
ref’s art occupies atstage.scale1,(x0, y0, x1, y1)in scene pixels relative to its placement point;Nonewhen it draws nothing that can be measured (an unknown ref drawn as a placeholder is still measured: that is what the shot would show).>>> from an.ir.schema import AssetRef >>> native_box(AssetRef(kind="voice", id="v", store="voices", ref="v"), {}, width=320, height=240) is None True
- an.stage.world.seed_world(scene, mall, shot_id, *, focal=None, depth=None)[source]#
scenewith a world derived from its hand-placed shotshot_id(an.ir.world_from_shot.seed_members(), an#514): the members, and one viewpoint named after the shot, a camera at the origin withfocal(pixels; default: the default field of view, so the world frames the same at any resolution). The shot names that viewpoint and keeps its ownstagelines, which agree with the world. The art is measured here, as the lowering measures it (native_box(); a measurement that fails leaves the entity out, said inskipped).Raises
ValueErrorfor a scene that already has a world, an unknown shot or one that already names a viewpoint, and whatseed_members()refuses.>>> seed_world(SceneIR(), {}, "a") Traceback (most recent call last): ... ValueError: no shot 'a' in the scene (its shots: [])
- Return type: