an.ir.schema#
Pydantic v2 models for the Scene IR.
Design principles (locked in from the architectural plan):
Renderer-agnostic. No cutout-specific or Manim-specific fields here. Backend adapters compile shots into their own internal formats. This module only knows what every shot has in common.
Versioned envelope. Every IR document carries
versionandcompatible_version. Migrations live inan.ir.migrate.Forward-compatible reads. Top-level model has
extra="allow"so a future field doesn’t crash an older reader.**Open
Actionunion** (ADR 0001 decision 2). The union holds the core kinds (set,tween,sequence,parallel,delay,loop) and ONE open member,ExtensionAction, which a callable discriminator selects for any otherkind. A genre registers its kinds (an.genres); a document’skind: playthen validates to the registered model, and before registration it stays anExtensionActionthat round-trips untouched and that validate, flatten and the compiler refuse by name. The union is never rebuilt at registration.Time in seconds (float). Always.
Doctest:
>>> from an.ir.schema import SceneIR, Meta, Shot
>>> scene = SceneIR(
... meta=Meta(title="Park Bench", duration=45.0),
... timeline=[Shot(id="s1", renderer="cutout", duration=45.0)],
... )
>>> from an.base import SCHEMA_VERSION
>>> scene.version == SCHEMA_VERSION
True
>>> scene.kind
'SceneIR'
>>> scene.timeline[0].renderer
'cutout'
Module Attributes
how long a jolt lasts, how far the frame jumps (a fraction of the frame HEIGHT, so it reads the same at any resolution: 0.015 is about 11 px at 720p), and how many times a second it jumps. |
|
the stage's axes extended with depth — |
|
The horizontal field of view a viewpoint has when it names neither |
|
Shot sizes, by where the frame cuts the subject (the film convention, see ADR 0009): |
|
nearer than |
|
How far a stream instance's screen position may stray from the fitted tweens between two of their keys, in pixels: the fitting's tolerance. |
|
The most actions one shot's travel may lower to before the lowering refuses and names the knobs: a 10 s road with three streams is about four thousand; a minute of dense road markings would be fifty thousand, which is a document the runtime pays for on every frame. |
|
the world itself. |
|
The frame a |
|
|
|
The key an element's frame is written under in a document ( |
|
The joint types a scene declares. |
|
The types that join a point to a segment ( |
|
|
|
the shot's floor line. |
|
The point name that makes |
|
a rig part's own joint to its parent. |
|
How a distance holds its length; |
|
The pull of gravity a |
|
Where each named gravity direction pulls, on the stage's y-down axes. |
|
The spellings of no gravity. |
|
at infinity, or rigid with the vehicle the viewpoints are mounted on. |
|
Gravity, world units per second² along +y (down; the world's units are metres): Earth's. |
|
The most a member of a swaying frame leans by default, degrees. |
|
The |
|
The union tag of the open member. |
|
the core kinds plus |
|
the broadcast convention (BBC / Netflix timed-text guidance: 42 characters, two lines). |
|
Caption type size as a fraction of frame height — a little under the title default, as captions are read while something else is watched. |
|
the scene's |
|
The property space a 2D stage engine's node lives in ( |
|
How long a specimen shot runs ( |
|
The id of a specimen shot. |
Functions
|
The acceleration a gravity declaration means, or |
|
The stepped-timing policy |
|
A short shot showing the one stage entity |
|
The error for an action |
Classes
|
Reference to an entry in a project store. |
|
A member that goes where another member goes (ADR 0009 decision 1). |
|
Camera state for a shot: a named move, or explicit keys. |
|
A camera that follows an entity (an#445): the frame keeps |
|
One camera pose at one time — the explicit door behind the named moves. |
|
A jolt of the frame inside a shot (an#429): seeded screen-space jitter. |
|
Captions for the whole film, built from the dialogue's word timings. |
|
A sound cue's time, taken from the picture (an#317): when a node reaches a frame row or column, or when an item's hold event happens. |
|
Where a sound cue ends: at another cue's start, plus |
|
Composition: an empty span that consumes time. |
|
One line of spoken dialogue. |
|
An action of a kind the core does not define: the IR's one open member. |
|
A frame of reference: a pose (position and orientation) over film time, relative to its |
|
A frame translating at a constant velocity: sugar for a frame whose |
|
Opt-in sway of an accelerating frame (an#504): what rides in it leans away from the acceleration by |
|
A declared relation between two bodies (ADR 0008 decision 3). |
|
Composition: repeat |
|
Scene metadata. |
|
Off-screen narration. |
|
Composition: run all children simultaneously starting at the same time. |
|
Pixel dimensions of the rendered output. |
|
Top-level Scene IR document. |
|
The scene's one light (catalogue D1, an#519): where it comes FROM on screen, a |
|
Composition: run children one after the other. |
|
Set a property to a value at a specific time. |
|
A single rendered unit. |
|
How a shot's joints are solved: a per-shot override of the style pack's |
|
One sound placed on the timeline: an SFX hit, an ambience, a music bed. |
|
Where an entity stands on the stage, and how big it is. |
|
A row of one prop along a travel's direction (ADR 0009 decision 4). |
|
How a shot is ENTERED — from the previous shot, or (for the first shot) from nothing. |
|
The viewpoints moving through the world in film time (ADR 0009 decision 4). |
|
Animate a property from a start value to an end value over a duration. |
|
A pinhole camera onto the world, or a composition that resolves to one (ADR 0009 decision 2). |
|
A single mouth-shape keyframe in a viseme track. |
|
Aligned viseme track produced by the lip-sync stage. |
|
One loudness for every voice of the film (an#315). |
|
A held item: |
|
One word of a line and when it was spoken, in seconds from the line's start (like |
|
A scene's world: members at positions, the named viewpoints that are its coverage, and its travel (ADR 0009). |
|
An entity of the scene's world: the same reference a shot's entity carries, at a world position with a size (ADR 0009 decision 1). |
- an.ir.schema.Action#
the core kinds plus
ExtensionActionfor any otherkind(a registered genre kind validates to its own model through it).SerializeAsAnymakes a typed genre instance (aPlayAction) serialize with its own fields rather than the open member’s.- Type:
Every action
alias of
Annotated[Annotated[SetAction,Tag(tag=set)] |Annotated[TweenAction,Tag(tag=tween)] |Annotated[SequenceAction,Tag(tag=sequence)] |Annotated[ParallelAction,Tag(tag=parallel)] |Annotated[DelayAction,Tag(tag=delay)] |Annotated[LoopAction,Tag(tag=loop)] |Annotated[ExtensionAction,SerializeAsAny(),Tag(tag=extension)],Discriminator(discriminator=_action_tag, custom_error_type=None, custom_error_message=None, custom_error_context=None)]
- class an.ir.schema.AssetRef(*, kind, id, store, ref, overrides=None, stage=None, library=None, joints=<factory>, **extra_data)[source]#
Bases:
_IRModelReference to an entry in a project store.
The IR never inlines large assets. Instead it references them by store name + key, so the same character/voice/environment is reusable across scenes.
overrideslets a single shot tweak presentation without forking the asset.>>> AssetRef(kind="character", id="maya", store="characters", ref="maya-v1").id 'maya'
- joints: list[JointSpec]#
its parts’ limits, its strings, its pins to other entities;
ais relative to the entity. Omitted when empty, so no stored scene changes.- Type:
Joints this entity declares (
JointSpec, ADR 0008)
- kind: str#
it selected nothing (the compiler skipped it, nothing read the styles store) and the name belonged to the renderer selector. Art direction arrives as a StylePack (#112).
A
strin the schema, not aLiteral(ADR 0001 decision 2): the values are the REGISTERED entity kinds (an.genres) — the core’senvironment,propandvoice, a genre’scharacter— andan validatechecks it against that registry, naming the genre that provides an unregistered one.- Type:
"style"was retired in an#106
- library: str | None#
The asset-library version this entry was checked out from (ADR 0005 decision 8):
"[<library>:]<asset_id>@<version>", e.g."cutan:character.alice-reiniger@v003"(grammar:an.library.ids.parse_ref(), a pinned version required:vNNNorsha256:<prefix>, neverlatest).None— the default, and every document written before the library existed — means the asset is the project’s own. Today the strategy is check-out, sorefstill names the project-store key the compiler reads and this field is the pin beside it; live reference resolves it instead, later.Additive and omit-when-unset, like
stage: an unsetlibraryleaves no trace in a dump, so no stored scene changes and no schema version moves.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- stage: StagePlacement | None#
Where on the stage this entity stands.
None— the default and what every existing document has — means “wherever the layout puts it”, which for characters is the evenly-spaced row the compiler computes.Additive by construction, and hash-free by construction: the contract hashes the COMPILED document, and an
AssetRefnever reaches it. So this field can grow without retiring a single ledger row.
- class an.ir.schema.Attachment(*, to, at=None, scale=1.0, **extra_data)[source]#
Bases:
_IRModelA member that goes where another member goes (ADR 0009 decision 1).
>>> Attachment(to="paul", at=(8.0, 70.0), scale=0.9).to 'paul'
atis the offset in the HOST’s native units (its art’s pixels atstage.scale1) andscalethe size relative to the host, so the pair is derived from the host’s placement in every framing. Withoutatthe member is added whenever the host is, with no placement of its own: another pass places it (the cut-out genre’s body attachments, from the host’s bones).
- an.ir.schema.CORE_ACTION_KINDS: tuple[str, ...] = ('set', 'tween', 'sequence', 'parallel', 'delay', 'loop')#
The
kindof every action the core defines (the static union members).
- class an.ir.schema.Camera(*, shake=None, follow=None, move=None, keys=None, **extra_data)[source]#
Bases:
_CameraShakesCamera state for a shot: a named move, or explicit keys.
>>> Camera(move="push_in").move 'push_in' >>> Camera(keys=[CameraKey(at=0.0), CameraKey(at=2.0, x=-200.0)]).keys[1].x -200.0
One code path, two front doors — the shape the dialogue
[emotion]sugar already uses. A namedmovedesugars to a key list;keysis that list written out. Setting both raises, because a scene that says two things about the same camera has no reading that is not a guess.keysdefaults toNone, not[], and that too is load-bearing: the markdown writer dumps the camera withexclude_none=True, which KEEPS empty lists — an empty default would writekeys: []into every camera block it regenerates.position,targetandfocal_lengthwere removed in an#109. They were written into everyscene.mdthis package ever generated and read by nothing; a registered migration drops them.
- class an.ir.schema.CameraFollow(*, target, axes='x', lag=0.0, **extra_data)[source]#
Bases:
_IRModelA camera that follows an entity (an#445): the frame keeps
targetwhere it stood at the shot’s start.>>> CameraFollow(target="bob").axes 'x'
targetis an entity id or one of its nodes (bob/head);axesis which way the camera tracks it (x: a side-scrolling walk,xy: both). Resolved at compile time from the compiled motion (the target’s position at every frame), so planes parallax with it like any camera move. The camera’skeysmay laydollyandzoomover a follow (an#625): it closes in on the target, holding it where it stood on screen.
- class an.ir.schema.CameraKey(*, at=0.0, x=0.0, y=0.0, zoom=1.0, rotation=0.0, dolly=0.0, easing=None, **extra_data)[source]#
Bases:
_IRModelOne camera pose at one time — the explicit door behind the named moves.
>>> CameraKey(at=1.0, x=-160.0, zoom=1.25).x -160.0
Sign convention, stated because every surveyed tool disagrees:
+xmoves the CAMERA right, which moves the content left.zoomis on-screen magnification, so1.25means “everything 25% bigger”, and it composes through the pivot — a push-in during a pan zooms toward what the camera is looking at rather than toward a fixed frame centre.rotationis camera roll in radians.easingdefaults to `None`, not `”ease_in_out”`, and that is not a style choice: today’s emitter puts"ease_in_out"on the first keyframe andnullon the terminal one, so a per-key default of"ease_in_out"would put it on both and move every camera scene’s contract hash. The named moves supply the easing they have always supplied.- dolly: float#
How far the camera has travelled toward the scene (an#478), as a fraction of its distance to the character plane:
0.2is a fifth of the way, negative is backing away. Unlikezoomit grows each plane by its depth (a pinhole camera): the foreground most, the sky not at all. Below1: at1the camera stands on the character plane.
- class an.ir.schema.CameraShake(*, at=0.0, duration=0.4, amplitude=0.015, frequency=24.0, decay=True, seed=0, **extra_data)[source]#
Bases:
_IRModelA jolt of the frame inside a shot (an#429): seeded screen-space jitter.
>>> CameraShake(at=1.0).duration 0.4
Layered on whatever the camera does (a
move,keys, or nothing): the pan and zoom are the root’s pivot and scale, a shake is its screen position, so the two add without either knowing the other. The jitter is deterministic (seed) and, withdecay, falls linearly to rest by the end; the frame is exactly at rest beforeatand after it.- decay: bool#
Fall linearly to rest over the duration (an impact); off, it holds its amplitude to the end (a rumble).
- class an.ir.schema.Captions(*, burn=True, sidecar=True, max_chars=42, max_lines=2, size=0.05, color='#1a1a1a', highlight=None, anchor='bottom', font=None, strict=False, **extra_data)[source]#
Bases:
_IRModelCaptions for the whole film, built from the dialogue’s word timings.
Present = on;
meta.captionsunset (the default) is no captions and no trace in any document. One cue list (an.captions.caption_pages()) feeds BOTH outputs, so the picture and the sidecar cannot disagree:burn: each page is drawn as an overlay text block (camera-immune, placed atanchorin the title-safe area), shown for exactly the frames the sidecar says;sidecar: a SubRip.srtwritten through thecaptionsstore, next to the delivered mp4, in FILM time (a dissolve shortens the film, and every later cue moves with it).
>>> Captions().max_chars, Captions().anchor (42, 'bottom') >>> Captions(highlight="#ffcc00").highlight '#ffcc00'
- font: str | None#
None= the embedded face; else an ABSOLUTE font file path, or one relative to the project directory.
- highlight: str | None#
the word being spoken is drawn in this colour (karaoke);
Nonedraws every word incolor.- Type:
#rrggbb
- max_chars: int#
Line breaks are made HERE, by character count, and written into both the burned block and the sidecar — the same lines in both. 42 fits the title-safe width of a 16:9 or 4:3 frame at the default size; a square or portrait frame needs fewer (about 32 at 1:1) or a smaller
size— a line that does not fit is REFUSED before the render, never clipped.
- class an.ir.schema.CueAnchor(*, when, reaches=None, event=None, changes=None, to=None, nth=1, offset=0.0, shot=None, **extra_data)[source]#
Bases:
_IRModelA sound cue’s time, taken from the picture (an#317): when a node reaches a frame row or column, or when an item’s hold event happens.
A crossing:
whenis a node path in a stage shot (crawl/line_7: a text block’s unit, a prop, a plane);reachesis{"y": px}or{"x": px}in the frame’s pixels (0 at the top or left), crossed in either direction by the node’s on-screen centre — the camera, parallax and a crawl’s tilt included.A hold event:
whenis an item (an entity a hold verb moves, or a body atopplemoves) andeventwhat happens to it, as the compiled shot’s hold report records it (an.stage.hold.HOLD_EVENTS):grasp(a hand takes it),place(it arrives where it is put),contact(either),release(let go),land(it first touches the floor),bounce,rest;nthpicks the n-th such event (1: the first). The swap’s clink is{when: sabre, event: place}; the drop’s thud{when: musket, event: land}.An authored change (an#815):
whenis the node asetor atweenof the shot targets andchangesthe property it changes;to(optional) the value it changes it to. The anchor is the instant of thenthsuch action in the shot’s own actions (aset’sat, atween’s start), so a page-turn sound follows the page wherever itssetis retimed:{when: book/body, changes: state, to: page_l}.Resolved when the film is laid out, never written back into the scene: a layout or timing change moves the sound with the picture.
offsetis added after.shotnames the shot to look in, for a cue inmeta.sounds(default: the first shot that has the node).>>> CueAnchor(when="crawl/line_7", reaches={"y": 840}).axis ('y', 840.0) >>> CueAnchor(when="musket", event="land").describe() 'musket land' >>> CueAnchor(when="musket", event="land").model_dump() {'when': 'musket', 'event': 'land', 'offset': 0.0, 'shot': None} >>> CueAnchor(when="book/body", changes="state", to="page_l").describe() 'book/body state to page_l'
- describe()[source]#
The anchor in words, for a finding:
crawl/line_7 reached y=840,musket land,book/body state to page_l.- Return type:
- class an.ir.schema.CueUntil(*, cue, offset=0.0, **extra_data)[source]#
Bases:
_IRModelWhere a sound cue ends: at another cue’s start, plus
offset(an#317).cueis thesoundkey of a cue in the same list (the shot’s, ormeta.sounds); the first such cue is meant.
- an.ir.schema.DEFAULT_CAPTION_MAX_CHARS: int = 42#
the broadcast convention (BBC / Netflix timed-text guidance: 42 characters, two lines).
- Type:
Characters per caption line and lines per caption page
- an.ir.schema.DEFAULT_CAPTION_SIZE: float = 0.05#
Caption type size as a fraction of frame height — a little under the title default, as captions are read while something else is watched.
- an.ir.schema.DFLT_FOV_DEG: float = 50.0#
The horizontal field of view a viewpoint has when it names neither
fovnorfocal: a normal lens, neither wide nor long.
- an.ir.schema.DFLT_GRAVITY: float = 980.0#
The pull of gravity a
downwith no number means, in scene px per second² (a 1080-px frame is about 1.1 m of a standing figure, so 980 is earth’s g at roughly one pixel per millimetre: the conventional animation default).
- an.ir.schema.DFLT_SHAKE_DURATION: float = 0.4#
how long a jolt lasts, how far the frame jumps (a fraction of the frame HEIGHT, so it reads the same at any resolution: 0.015 is about 11 px at 720p), and how many times a second it jumps. Art direction, chosen to read as an impact rather than a tremor.
- Type:
A camera shake’s defaults (an#429)
- an.ir.schema.DFLT_SWAY_LIMIT_DEG: float = 75.0#
The most a member of a swaying frame leans by default, degrees.
- an.ir.schema.DFLT_TRAVEL_MAX_ACTIONS: int = 20000#
The most actions one shot’s travel may lower to before the lowering refuses and names the knobs: a 10 s road with three streams is about four thousand; a minute of dense road markings would be fifty thousand, which is a document the runtime pays for on every frame.
- an.ir.schema.DFLT_TRAVEL_NEAR: float = 0.5#
nearer than
nearan instance has passed the camera (and is hidden); beyondfarit is effectively at infinity (the far plate’s job, not a stream’s).- Type:
A travel’s depth range, in world units
- an.ir.schema.DFLT_TRAVEL_TOLERANCE_PX: float = 1.0#
How far a stream instance’s screen position may stray from the fitted tweens between two of their keys, in pixels: the fitting’s tolerance.
- an.ir.schema.DFLT_WORLD_GRAVITY: float = 9.81#
Gravity, world units per second² along +y (down; the world’s units are metres): Earth’s. A
motion: ballisticreframe falls with it (an.ir.reframe, which re-exports it) and aFrameSwayleans by it.
- an.ir.schema.DISTANCE_MODES: tuple[str, ...] = ('equal', 'at_most', 'at_least')#
How a distance holds its length;
stringandrodimply one.
- class an.ir.schema.DelayAction(*, name=None, kind='delay', duration, **extra_data)[source]#
Bases:
_ActionBaseComposition: an empty span that consumes time.
- class an.ir.schema.Dialogue(*, speaker, text, voice_ref=None, start=None, duration=None, emotion=None, emotion_intensity=None, viseme_track=None, word_timings=None, audio_ref=None, viseme_ref=None, leveled=None, spoken=None, pause=None, at=None, direction=None, **extra_data)[source]#
Bases:
_IRModelOne line of spoken dialogue.
startanddurationare None until the audio pipeline runs (TTS gives us a real duration); the pipeline stamps them then, derivingstartfrom the author’spause/at(planned_start()).- at: float | None#
Where this line starts, in SHOT seconds, whatever came before it —
(at 3.0)inscene.md.startis what the audio pipeline DERIVES fromat/pauseon every pass; these two are what the author wrote (an#187).
- direction: list[str] | None#
How the line is DELIVERED — cues such as
["excited"]or["sighs", "annoyed"],{excited}inscene.md(an#209). A TTS model that takes inline audio tags (ElevenLabs v3/v4) receives them as[excited] Hi!; others ignore them. Never part oftext, so captions and lip-sync alignment never see a cue.
- emotion_intensity: float | None#
maya [angry 0.4]: …inscene.md, a typed parameter on the (b-name) emotion.Noneis full strength, and is omitted from JSON.- Type:
How strongly
emotionshows, 0..1 (an#253)
- leveled: dict | None#
<the synthesized line’s audio_ref>, “gain_db”: <its voice’s gain>}`` when
audio_refis the leveled audio.None— unleveled — is omitted from JSON.- Type:
Stamped by voice leveling (an#315)
- Type:
``{“source”
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- pause: float | None#
Seconds of silence before this line, after the previous line’s speech ends (the shot start, for the first line) —
(pause 1.5)inscene.md.
- planned_start(cursor)[source]#
Where this line starts, given the previous line ends at
cursor.The one rule the audio pipeline stamps into
startandan validatelays lines out by:atif set, elsecursor + pause. Astarton a line never synthesized (noaudio_ref) was authored — the spelling ofatbefore an#187 — and counts as one; a synthesized line’sstartis the pipeline’s own stamp, re-derived here.>>> Dialogue(speaker="a", text="bye", pause=1.5).planned_start(0.8) 2.3 >>> Dialogue(speaker="a", text="bye", at=4.0).planned_start(0.8) 4.0 >>> Dialogue(speaker="a", text="bye").planned_start(0.8) 0.8
- Return type:
- spoken: float | None#
seconds from the line’s start to the end of its AUDIBLE speech — its take’s own trailing silence left out — stamped with
durationfrom the line’s audio. The next line’spausecounts from here (a line with no pause still follows the whole take).None(silent audio, a line its voice’strim_silencealready cut to the tail the author keeps, a line stamped before an#397) counts from the end ofduration, as before. Never written to JSON: it is read off the line’s stored audio on every pass (the audio pipeline, and a render that skips synthesis), soscene.jsonand its fixtures do not change.- Type:
DERIVED (an#397)
- word_timings: list[WordTimingIR] | None#
The provider’s word timings, line-relative;
Nonewhen the provider has none (offline, Rhubarb) or the line was stamped before an#96.
- class an.ir.schema.ExtensionAction(*, name=None, kind, **extra_data)[source]#
Bases:
_ActionBaseAn action of a kind the core does not define: the IR’s one open member.
The schema’s
Actionunion selects this for anykindother than the core’s (ADR 0001 decision 2). When a genre has REGISTERED that kind (an.genres.registry.register_action_kind()), validating a document yields the registered model instead — aPlayActionforkind: play— so code downstream sees typed actions. Before registration the action stays anExtensionAction: its fields are kept as extras and round-trip byte for byte, andresolved()(called byflatten,an validateand the compiler) refuses it naming the genre that provides it.Every genre’s action model subclasses this, which is what lets a typed instance sit in the union and serialize with its own fields.
>>> ExtensionAction(kind="wave", target="flag").model_dump() {'name': None, 'kind': 'wave', 'target': 'flag'}
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- resolved(*, strict=True)[source]#
This action as its registered model.
A typed instance is returned as is. A bare
ExtensionActionis validated by the model its kind registered — or, unregistered, raisesUnregisteredKindError(strict) or comes back unchanged (strict=False).- Return type:
- an.ir.schema.FAR_COUPLING: str = 'far'#
rigidtakes the parent’s whole pose,faronly its rotation (what is at infinity turns with the camera and never translates).- Type:
How a frame follows its parent
- an.ir.schema.FAR_PLATE_ROLE: str = 'far'#
at infinity, or rigid with the vehicle the viewpoints are mounted on.
- Type:
What a plane under a travel may be declared as
- an.ir.schema.FRAME_KEY: str = 'in'#
The key an element’s frame is written under in a document (
frameis the field;inis not a name Python lets a field have).
- class an.ir.schema.Frame(*, parent='world', at=(0.0, 0.0, 0.0), look=(0.0, 0.0, 0.0), coupling='rigid', moving=None, sway=None, sockets=<factory>, **extra_data)[source]#
Bases:
_IRModelA frame of reference: a pose (position and orientation) over film time, relative to its
parent(ADR 0009 amendment, an#501).>>> Frame(moving=FrameMoving(speed=20.0)).parent 'world' >>> Frame(parent="vehicle", coupling="far").coupling 'far'
atandlook([yaw, pitch, roll], as a viewpoint’s) are the pose in the parent’s units at film time 0;movingadds a constant velocity; aset/tweenof<frame>:at_x|at_y|at_z|yaw|pitch|rollin a shot replaces the channel for that shot.coupling: farfollows the parent’s rotation and none of its translation: the frame of what is at infinity (a sky, a range of mountains).- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- class an.ir.schema.FrameMoving(*, direction=(0.0, 0.0, 1.0), speed, **extra_data)[source]#
Bases:
_IRModelA frame translating at a constant velocity: sugar for a frame whose
atgrows bydirection × speedper second of FILM time.>>> FrameMoving(direction=(0.0, 0.0, 1.0), speed=20.0).speed 20.0
- class an.ir.schema.FrameSway(*, gain=1.0, settle=0.0, gravity=9.81, limit=75.0, **extra_data)[source]#
Bases:
_IRModelOpt-in sway of an accelerating frame (an#504): what rides in it leans away from the acceleration by
gain × atan(a / gravity)(the pseudo-force of a non-inertial frame; follow-through and drag, in animation terms), settling with the time constantsettleseconds (0: at once). Fields at their default are left out of a dump.>>> FrameSway().gain 1.0 >>> FrameSway().model_dump(), FrameSway(gain=0.5, settle=0.2).model_dump() ({}, {'gain': 0.5, 'settle': 0.2})
- gravity: float#
Gravity in the frame’s units per second² (the world is in metres; a frame drawn at another scale says its own): the lean is
atan(a / gravity).
- an.ir.schema.GRAVITY_DIRECTIONS: dict[str, tuple[float, float]] = {'down': (0.0, 1.0), 'left': (-1.0, 0.0), 'right': (1.0, 0.0), 'up': (0.0, -1.0)}#
Where each named gravity direction pulls, on the stage’s y-down axes.
- an.ir.schema.GROUND_SURFACE: str = 'ground'#
the shot’s floor line.
- Type:
The surface a support names by a word
- an.ir.schema.JOINT_TYPES: tuple[str, ...] = ('pin', 'hinge', 'weld', 'distance', 'string', 'rod', 'slide', 'contact', 'support')#
The joint types a scene declares.
string(a distance held at most) androd(a distance held exactly) are the puppeteer’s names for adistancewith itsmodeset.
- an.ir.schema.JUMP_CUT_SIZE_RATIO: float = 1.3#
Shot sizes, by where the frame cuts the subject (the film convention, see ADR 0009):
name: (top, bottom, fill).top/bottomare the band of the subject’s box the frame shows, as fractions of its height from the top (0.35: head and shoulders;0.55: the waist);fillis how much of the frame’s height that band fills. These are human proportions; a genre gives a kind’s own bands from its rig (EntityKind.shot_sizes, reeleehq/cutan#106), andfillis always this table’s. Two views of one subject whose apparent sizes differ by less than this ratio (larger / smaller), from directions less than 30 degrees apart, are a jump cut (catalogue C4): about one shot-size step (a close-up fills 1.57 times a medium). The jump-cut check (an.verify.constraints) and the framing’s crop policy (an.ir.world.resolve_viewpoint()) both read it.
- class an.ir.schema.JointSpec(*, type, a, b=None, end=None, limits=None, length=None, mode=None, give=0.0, name=None, **extra_data)[source]#
Bases:
_IRModelA declared relation between two bodies (ADR 0008 decision 3).
>>> JointSpec(type="hinge", a="lamp/upper", limits=(-40, 90)).id 'lamp/upper' >>> JointSpec(type="pin", a="paul/fore_r@hand_r", b="wheel@grip", name="grip").id 'grip'
A body is a node path (
paul/fore_r, or an entity id for an entity with one root part), and a point on it follows@: a fraction of the body’s extent (@0.5,1), or the name of a bone of its rig (@hand_r: a bone with no slot is a landmark). With no@the point is the body’s pivot foraand the centre of its extent forb.world@x,yis a point of the stage, in scene px from its centre (StagePlacement.at’s ruler).pin: the two points coincide;hingeadds an angle range (limits, degrees about the rest pose,a’s body relative tob’s);weldholds the rest angle too. Ahingeorweldthat names onlya(a rig part) is that part’s own joint to its parent: itslimitsoverride the bone’s.distancekeepslength(default: the distance at rest) permode;stringis a distance held at most,rodexactly.slidekeepsaon the segmentbtoend;contactkeeps it on the segment’s free side (above a left-to-right segment).support(an#519) saysarests on the surfaceb: no contact point ofabelow it, and at least one on it.bisground,<body>@surface[@f], orworld@x,ywithend(SURFACE_REFS);awith no@is every contact of the body (an.stage.support.contacts_of(): a character’s feet, a prop’smetadata.contacts, its rig’sorigin, else its lowest ink), and@namemay name one. A lint only (thesupportcheck), never solved.
>>> JointSpec(type="support", a="cup@base", b="table@surface").id 'cup@base' >>> JointSpec(type="support", a="cup", b="world@-50,0", end="world@50,0").end 'world@50,0'
giveis the joint’s softness (compliance, px per unit of pull; 0 is rigid).nameis whatjoinandunjoincall it (default:a). On an entity (AssetRef.joints)ais relative to the entity (fore_r@hand_r,@0.5,0) andbis a path in the shot.
- an.ir.schema.LIGHT_KEYS: dict[str, tuple[float, float]] = {'bottom': (0.0, 1.0), 'left': (-1.0, 0.0), 'lower_left': (-1.0, 1.0), 'lower_right': (1.0, 1.0), 'right': (1.0, 0.0), 'top': (0.0, -1.0), 'upper_left': (-1.0, -1.0), 'upper_right': (1.0, -1.0)}#
the scene’s
light: {key: upper_left}(catalogue D1).- Type:
Where a named light comes FROM, on screen (x right, y down)
- class an.ir.schema.LoopAction(*, name=None, kind='loop', child, count=1, **extra_data)[source]#
Bases:
_ActionBaseComposition: repeat
childcounttimes.
- class an.ir.schema.Meta(*, title='', author='', duration=0.0, fps=30, resolution=<factory>, default_renderer='cutout', notes='', step_hz=None, style_pack=None, default_easing=None, sounds=<factory>, captions=None, closing_transition=None, voice_loudness=None, light=None, **extra_data)[source]#
Bases:
_IRModelScene metadata.
- captions: Captions | None#
Captions from the dialogue’s word timings (
Captions, an#175);None— the default — is none, omitted from JSON likestyle_pack.
- closing_transition: Transition | None#
a
fadeto itscolorover itsduration, on the last shot’s last frames (the film’s length is unchanged, and its final frame is the colour; the sound fades with it).None(or acut) ends on the last frame as drawn. A dissolve has nothing to dissolve into, so it is refused.- Type:
How the film ENDS (an#389)
- default_easing: str | tuple[float, float, float, float] | list[float] | None#
The easing every authored
tweenthat names none is drawn with (an#166) —"linear"for a snappy South Park cadence, an overshooting cubic-Bezier for a bouncy one. Precedence is **tween > this > the built-in"ease_in_out"``** (:meth:`TweenAction.resolved_easing`). ``None— the default and what every existing document has — changes nothing, and is omitted from JSON likestyle_pack, so no committed scene and no compiled document moves. It reaches authored tweens ONLY: a motion preset writes its own easings, the camera’s named moves supply theirs, and blinks,playclips and swap channels have none to inherit. There is no per-shot override yet — style is a scene’s.
- default_renderer: str#
a registered renderer’s name.
- Type:
Like
Shot.renderer
- light: SceneLight | None#
The scene’s one light (
SceneLight, catalogue D1);None— the default — declares none, checks nothing, and is omitted from JSON.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- sounds: list[SoundCue]#
Sound cues in FILM time — a music bed, an ambience under every shot (
SoundCue). Empty, the default, is no sound layer at all.
- step_hz: float | None#
Stepped timing for AUTHORED TWEENS, in pose updates per second;
None(the default) leaves every tween smooth. At 30 fps,15is “on twos” and10“on threes” — the character-animation practice Spider-Verse made famous (characters on twos, simulation on ones). The camera is exempt by construction, as are swap channels (already stepped by format), compiled blinks andplayclips: onlytweencurves are resampled — sample-and-hold of the eased curve on a SHOT-wide grid (every tween in a shot shares it; it restarts at a cut), not a retiming into holds and fast transitions. A tween’s own START and END are always pose changes too, so a tween that begins or ends off-grid changes pose on that frame as well as on the grid (asetat an off-gridatlikewise lands where it was authored). A shot’s ownstep_hzoverrides this. Must be positive (schema) and<= fps(validate + compile), an#89.
- style_pack: str | None#
The
StylePackin the project’sstylesstore this scene is drawn under, by key.None— the default and what every existing document has — leaves every colour exactly where it is, which is why adding this moved no corpus hash (an#112).A pack changes what the COMPILER decides: the character palette, the leg and pupil colours, the environment presets’ sky and ground — and SVG art whose descriptor tags its colours by role (
colour_roles, written byan character new). Untagged art is never inferred (inferring a role from a pixel is what produced an#99’s wrong-tone lid); a rig a pack cannot reach is WARNED about by name at compile.
- voice_loudness: VoiceLoudness | None#
One loudness for every voice (
VoiceLoudness, an#315);None— the default — levels nothing, and is omitted from JSON.
- class an.ir.schema.Narration(*, text, voice_ref=None, start=None, duration=None, viseme_track=None, word_timings=None, audio_ref=None, viseme_ref=None, **extra_data)[source]#
Bases:
_IRModelOff-screen narration. Same shape as Dialogue minus the speaker pin.
- an.ir.schema.PART_JOINT_TYPES: frozenset[str] = frozenset({'hinge', 'weld'})#
a rig part’s own joint to its parent.
- Type:
The types that may name only
a
- class an.ir.schema.ParallelAction(*, name=None, kind='parallel', children=<factory>, **extra_data)[source]#
Bases:
_ActionBaseComposition: run all children simultaneously starting at the same time.
- an.ir.schema.Point3#
the stage’s axes extended with depth —
xright,yDOWN,zaway from the viewer. The unit is the author’s.- Type:
A world position
(x, y, z)
alias of
tuple[Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[AllowInfNan(allow_inf_nan=False)])],Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[AllowInfNan(allow_inf_nan=False)])],Annotated[float, FieldInfo(annotation=NoneType, required=True, metadata=[AllowInfNan(allow_inf_nan=False)])]]
- class an.ir.schema.Resolution(*, width=1920, height=1080, **extra_data)[source]#
Bases:
_IRModelPixel dimensions of the rendered output.
- an.ir.schema.SEGMENT_JOINT_TYPES: frozenset[str] = frozenset({'contact', 'slide'})#
The types that join a point to a segment (
bis its start,endits end).
- an.ir.schema.SPECIMEN_DURATION: float = 0.5#
How long a specimen shot runs (
an library sheetdraws its first frame).
- an.ir.schema.STAGE_NODE_SPACE: str = 'stage.node'#
The property space a 2D stage engine’s node lives in (
an.timing.spaces).
- an.ir.schema.SURFACE_POINT: str = 'surface'#
The point name that makes
<body>@surfacea body’s supporting segment.
- an.ir.schema.SURFACE_REFS: frozenset[str] = frozenset({'support'})#
ground(the shot’s floor line),<body>@surfaceor<body>@surface@f(a body’s supporting segment, the hold layer’s grammar), orworld@x,ywithend(a stage segment).supportonly in v1: acontactis lowered by the solve, which resolves bodies and stage points only.- Type:
The types whose
bis a SURFACE reference (an#519)
- class an.ir.schema.SceneIR(*, version='0.3.0', compatible_version='0.3.0', kind='SceneIR', meta=<factory>, assets=<factory>, timeline=<factory>, world=None, **extra_data)[source]#
Bases:
_IRModelTop-level Scene IR document. The SSOT.
A document is portable, diffable, and renderer-agnostic. Persisted as JSON at
ir/scene.jsoninside an an project.>>> from an.base import SCHEMA_VERSION >>> doc = SceneIR(meta=Meta(title="Hello")) >>> doc.version == SCHEMA_VERSION True >>> round_tripped = SceneIR.model_validate_json(doc.model_dump_json()) >>> round_tripped.meta.title 'Hello'
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- world: World | None#
its members at world positions, its named viewpoints and its travel.
None— the default, and every document written before it existed — is no world at all: every shot is placed by hand. Omitted from JSON when unset (thestagerule), so no stored scene and no schema version moves.- Type:
The scene’s world (ADR 0009)
- class an.ir.schema.SceneLight(*, direction=None, key=None, elevation=None, **extra_data)[source]#
Bases:
_IRModelThe scene’s one light (catalogue D1, an#519): where it comes FROM on screen, a
direction[dx, dy](x right, y down) or a namedkey(LIGHT_KEYS), and itselevationin degrees when it matters. Art says which side it is shaded on (shaded_side), and thelightcheck holds every member to this one light.>>> SceneLight(key="upper_left").vector (-1.0, -1.0) >>> SceneLight(direction=(2.0, 0.0)).vector (2.0, 0.0)
- class an.ir.schema.SequenceAction(*, name=None, kind='sequence', children=<factory>, **extra_data)[source]#
Bases:
_ActionBaseComposition: run children one after the other.
- class an.ir.schema.SetAction(*, name=None, kind='set', target, property, value, at=0.0, **extra_data)[source]#
Bases:
_ActionBaseSet a property to a value at a specific time. Discrete, no tween.
- class an.ir.schema.Shot(*, id, renderer='cutout', duration=5.0, camera=None, entities=<factory>, actions=<factory>, dialogue=<factory>, narration=<factory>, options=<factory>, step_hz=None, transition=None, sounds=<factory>, policy=None, viewpoint=None, welds=<factory>, joints=<factory>, solve=None, continue_from=None, **extra_data)[source]#
Bases:
_IRModelA single rendered unit. A scene is a sequence of shots.
A shot’s
rendererselects the backend that draws it. Every renderer must accept the same Shot fields; renderer-specific options go underoptions.- continue_from: str | None#
"<shot id>"in this scene, or"<scene file>#<shot id>"in a sibling scene file. Every entity this shot shares with that one opens as that one ends (its transform, swap keys, alpha, and what holds it); this shot’s own openingset/tweenwins. Writtencontinue:in the shot block; resolved before compile (an.continuity).None(omitted): opens as staged.- Type:
Open from another shot’s end state (an#542)
- joints: list[JointSpec]#
Joints between this shot’s bodies (
JointSpec, ADR 0008); thesolvecompile pass keeps them at every frame. Omitted when empty.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- policy: dict[str, Any] | None#
per aspect, the methods it prefers in order, over the style pack’s (
StylePack.policy) and under an author’s request —{"locomotion": ["loco.glide"]}.None: the style’s.- Type:
This shot’s policy (an#348)
- renderer: str#
Which RENDERER draws this shot — not art direction. The field was called
styleuntil an#106, colliding with the styles store (which holds art direction) and withAssetRef(kind="style"); one word for two meanings is how a scene came to declare a “style” that selected a renderer while the thing that actually styles it went unread. Astrin the schema (ADR 0001 decision 2): any name a renderer registered (an.adapters.register_renderer), checked byan validate.cutoutstays the persisted default (decision 9).
- solve: SolveSettings | None#
mode, gravity and damping over the style pack’s.
None(omitted): the defaults.- Type:
How this shot is solved (
SolveSettings)
- step_hz: float | None#
Per-shot override of
Meta.step_hz(None= inherit).
- transition: Transition | None#
How this shot is entered (
Transition);Noneis a hard cut.
- viewpoint: str | Viewpoint | None#
the name of one of
world.viewpointsor an inlineViewpoint.None(the default, and every document written before the world existed) means the shot is placed by hand, as it always was. Omitted from JSON when unset, likepolicy.- Type:
This shot’s viewpoint onto the scene’s world (ADR 0009)
- class an.ir.schema.SolveSettings(*, mode=None, gravity=None, damping=None, iterations=None, substeps=None, ground=None, **extra_data)[source]#
Bases:
_IRModelHow a shot’s joints are solved: a per-shot override of the style pack’s
gravityanddamping, and the solve’s mode and effort (ADR 0008 decision 4).>>> SolveSettings(gravity="down 500").gravity_vector() (0.0, 500.0) >>> SolveSettings(mode="pose").model_dump() {'mode': 'pose'}
modeunset isdynamicwhen gravity or a string acts (follow-through, baked from frame 0) andposeotherwise (projection to convergence from the previous frame: dead still between keys).gravityunset is the style pack’s;"none"switches the pack’s off for this shot.groundis the floor line, a stagey(scene px from the stage centre, down positive): whereplaceputs an itemonto: ground, areleaselands it, and an itemoverrides: {held_by: ground}rests (an.ir.holds). Unset, a hand puts things on the floor its body stands on (the bottom of its rig’s root parts).>>> SolveSettings(ground=502).model_dump() {'ground': 502.0}
- class an.ir.schema.SoundCue(*, sound, at=0.0, until=None, cause=None, duration=None, gain_db=0.0, loop=False, fade_in=0.0, fade_out=0.0, duck_db=None, duck_attack=0.08, duck_release=0.3, **extra_data)[source]#
Bases:
_IRModelOne sound placed on the timeline: an SFX hit, an ambience, a music bed.
soundis a key in the project’ssoundsstore (an.sounds), where the bytes and their licence live — the IR never inlines audio.atis seconds from the start of whatever holds the cue: a shot’ssoundsare SHOT-local (they move with the shot, across transitions and re-orderings),meta.soundsare FILM time (a music bed under the whole thing).>>> SoundCue(sound="hit", at=1.2).gain_db 0.0 >>> SoundCue(sound="bed", loop=True, duck_db=-12).duck_db -12.0
- at: Union[float, CueAnchor]#
Seconds, or a
CueAnchorresolved from the picture when the film is laid out (an#317).
- cause: CueAnchor | None#
The visible event this sound is the sound OF, for a cue authored at a time (
atin seconds): thecausalitylint checks the sound does not precede it and stays within the audio-visual window (catalogue B7). A shot cue only; an anchoredatalready is its cause.
- duck_db: float | None#
Attenuation, in dB, while any dialogue line plays;
Nonenever ducks. A music bed usually wantsDEFAULT_DUCK_DB; an SFX hit wants none.
- duration: float | None#
the asset’s own length, or — when
loop— to the end of its shot (shot cue) or of the film (meta cue).- Type:
How long it plays.
None
- class an.ir.schema.StagePlacement(*, at=None, scale=1.0, after=None, **extra_data)[source]#
Bases:
_IRModelWhere an entity stands on the stage, and how big it is.
>>> StagePlacement(at=(120.0, -40.0), scale=0.5).at (120.0, -40.0) >>> StagePlacement().at is None True
atis in SCENE pixels relative to the stage centre — the same space the compiler already places characters in — so an author reads it off the same ruler as a camera pivot.scalemultiplies the rig’s own uniform scale.`after` landed in an#344 (a studio set’s sky disc between a sky plane and a holed wall plate): it names the anchor the entity is drawn right after.
depthis still not a field: an entity takes the depth of the plane it is placed after. The paragraphs below are the record of why both were deferred, kept becausedepth’s reason still holds.**Deliberately only two fields, and the reason has been re-stated because the first one expired.** #108 sketched
depthandafteras well, deferred on the grounds that they belong to a stage vocabulary that had not arrived. It arrived the same day: #109 landed the translating camera and #110 landed plane environments, and nothing revisited this paragraph — a deferral citing a condition outlives the condition silently, which is why the reason below cites a state instead (an#126).The current reason is simply that **nothing reads them and nothing has asked to.** Shipping either now would put a knob in the schema that a scene can set, that renders identically, and that says nothing — which is worse than an absent one, and is the same defect
an.styles.UNREACHABLE_ROLESrefuses by construction on the other side of the compiler.What each would cost, so the next reader does not re-derive it:
depthwould place a prop on a parallax plane, which means parenting the prop into that plane’s subtree — and_track_root_ofmakes entity identity the first path segment, so every animation target on that prop changes shape.afterwould order a prop against planes, which ischaracters_after’s problem a second time; that one needed the environment and character builders interleaved before any ordering could be expressed at all.
Neither is hard. Both are unmotivated, and an unmotivated knob in a versioned schema is a migration you owe later for a feature nobody used.
- after: str | None#
an environment plane (
"set/skyline") or another placed entity ("grid").None= the default band, where the environment’scharacters_aftercuts. A plane’s parallax carries an entity placed after it; an entity placed after an entity rides the default depth.- Type:
What this entity is drawn immediately after (an#344)
- at: tuple[float, float] | None#
(x, y)in scene pixels from the stage centre.None= default layout.allow_inf_nan=Falseon both fields, and it is not pedantry: pydantic serializesinfandnanto JSON null, and re-validating that JSON raises — so a scene file written with either is corrupt one way, and the author finds out on the next load rather than at the edit that did it (an#108 review, M-1).gt=0already refusesscale=0andscale=-1; it does not refuseinf.
- class an.ir.schema.Stream(*, id, ref, kind='prop', store='props', height=None, width=None, units_per_px=None, every, lane=0.0, y=0.0, after=None, seed=0, frame=None, **extra_data)[source]#
Bases:
_IRModelA row of one prop along a travel’s direction (ADR 0009 decision 4).
>>> Stream(id="tree", ref="olive_tree", height=4.0, every=(1.0, 3.0), lane=(-3.0, -2.0)).id 'tree'
Instances
<id>_<k>standeveryworld units apart along the direction (a range is seeded-uniform),laneto the right of it (negative: left), at heighty; sized like a member. They are positioned in the world once, so every shot sees the same instances in the same places at the same film time.
- class an.ir.schema.Transition(*, kind='cut', duration=0.5, color='#000000', direction='left', time_jump=False, **extra_data)[source]#
Bases:
_IRModelHow a shot is ENTERED — from the previous shot, or (for the first shot) from nothing.
>>> Transition(kind="dissolve", duration=0.5).duration 0.5 >>> Transition(kind="fade").color '#000000'
cut— the default, and what a shot with notransitionmeans.fade— throughcolor: the previous shot’s lastduration / 2fades to the colour and this shot’s firstduration / 2fades up from it. On the FIRST shot the wholedurationis a fade up from the colour. Holds the film’s length: nothing overlaps.dissolve— the previous shot’s lastdurationseconds and this shot’s firstdurationseconds are seen through each other. **The film getsdurationshorter** than the sum of its shots: both shots play in full, overlapped (the editor’s convention — the overlapped seconds are each shot’s “handle”). Dialogue stays in sync with its own shot’s picture; audio from both shots is heard in the overlap. Not allowed on the first shot.wipe— overlaps like a dissolve, but a hard edge sweeps across the frame indirection(the way the edge travels:leftbrings this shot in from the right), this shot on the side it has passed (an#390). The edge stands where a dissolve’s mix would:(j + 1) / (k + 1)of the way across on overlap framejofk. Not on the first shot.
- direction: Literal['left', 'right', 'up', 'down']#
A
wipe’s direction; omitted from a dump for every other kind.
- class an.ir.schema.Travel(*, direction=(0.0, 0.0, 1.0), speed=None, near=0.5, far=60.0, tolerance_px=1.0, max_actions=20000, streams=<factory>, plates=<factory>, **extra_data)[source]#
Bases:
_IRModelThe viewpoints moving through the world in film time (ADR 0009 decision 4).
>>> t = Travel(speed=20.0, streams=[Stream(id="pole", ref="pole", height=6.0, every=12.0, lane=2.0)]) >>> t.direction, t.speed ((0.0, 0.0, 1.0), 20.0)
The vehicle the members and viewpoints ride moves at
speedworld units per second of FILM time alongdirection;streamsstream past betweennearandfar.platesdeclares every plane a framed shot’s environment holds asfar(at infinity; its parallax factor must be 0) orvehicle(rigid with the camera):{"far": ["set/rear_view"], "vehicle": ["set/cabin"]}. A plane in neither is a validate warning, because a plate with near objects baked in stands still while the streams move.
- class an.ir.schema.TweenAction(*, name=None, kind='tween', target, property, to_value, from_value=None, duration=1.0, easing='ease_in_out', **extra_data)[source]#
Bases:
_ActionBaseAnimate a property from a start value to an end value over a duration.
- easing: str | tuple[float, float, float, float] | list[float] | None#
a tween that does not name an easing takes the scene’s
Meta.default_easing, and only when that is unset too the built-in"ease_in_out"this default spells. “Unset” is"easing" not in model_fields_set— the default stays the literal so every reader of.easingstill sees the curve a scene without a default draws — and the serializer below omits an unset easing, so the distinction survivesscene.json.Noneis an explicit LINEAR ramp (the evaluators’ reading of a null easing), not “unset”.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow', 'populate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [
ConfigDict][pydantic.config.ConfigDict].
- resolved_easing(default=None)[source]#
The easing this tween draws with under a scene default of
default— the ONE statement of the precedence **tween > scene (Meta.default_easing) > built-in ``”ease_in_out”``** (an#166).>>> TweenAction(target="a", property="x", to_value=1).resolved_easing("linear") 'linear' >>> TweenAction(target="a", property="x", to_value=1, easing="ease_in_out").resolved_easing("linear") 'ease_in_out' >>> TweenAction(target="a", property="x", to_value=1).resolved_easing(None) 'ease_in_out'
- Return type:
- an.ir.schema.VEHICLE_FRAME: str = 'vehicle'#
The frame a
travelwith aspeedis sugar for (viewpoints and members ride it by default; streams stay in the world).
- class an.ir.schema.Viewpoint(*, at=None, look=(0.0, 0.0, 0.0), look_at=None, vanish=None, fov=None, focal=None, subject=None, size=None, distance=None, subject_at=(0.0, 0.0), hide=<factory>, frame=None, **extra_data)[source]#
Bases:
_IRModelA pinhole camera onto the world, or a composition that resolves to one (ADR 0009 decision 2).
>>> Viewpoint(at=(0.0, 0.0, 0.0), vanish=(0.0, -262.0)).vanish (0.0, -262.0) >>> Viewpoint(subject="paul", size="close_up", subject_at=(190.0, 0.0)).size 'close_up'
A camera:
at(world), its look aslook: [yaw, pitch, roll]in degrees (yaw turns right, pitch looks down, roll turns the picture clockwise), orlook_at(a world point), orvanish(where the+zdirection lands on screen, in pixels from the frame centre: the road’s vanishing point), andfov(horizontal, degrees) orfocal(pixels).A composition:
subject(a member, or a list),size(aSHOT_SIZESname) ordistance(world units), andsubject_at(where the subject’s band lands on screen, pixels; the centre by default). The camera is computed on the look direction so the band fills the frame as the size says.hidenames members this shot leaves out.
- class an.ir.schema.VisemeKeyframe(*, time, viseme, **extra_data)[source]#
Bases:
_IRModelA single mouth-shape keyframe in a viseme track.
- class an.ir.schema.VisemeTrack(*, fps_hint=None, keyframes=<factory>, **extra_data)[source]#
Bases:
_IRModelAligned viseme track produced by the lip-sync stage. Optional in P1.
- class an.ir.schema.VoiceLoudness(*, target_lufs=-16.0, peak_db=-1.5, **extra_data)[source]#
Bases:
_IRModelOne loudness for every voice of the film (an#315).
TTS voices arrive at very different levels (a 19 dB spread measured on one episode). Set, the render levels each voice: its integrated loudness over ALL its lines (EBU R128), one gain to
target_lufs(plus the voice document’sloudness_offset_db), peaks held atpeak_dbdBFS by a lookahead limiter — derived audio, content-keyed, never re-synthesised (an.audio.loudness). Unset, the default, levels nothing.>>> VoiceLoudness().target_lufs, VoiceLoudness().peak_db (-16.0, -1.5) >>> VoiceLoudness.model_validate(-20).target_lufs # a bare number is the target -20.0
- an.ir.schema.WORLD_FRAME: str = 'world'#
the world itself. Always present, never declared.
- Type:
The root of the frame tree
- class an.ir.schema.Weld(*, item, by, start=0.0, until=None, offset=None, **extra_data)[source]#
Bases:
_IRModelA held item:
itemstays atoffsetfrombybetweenstartanduntil(catalogue A4). Pick-up isstart, release isuntil.>>> Weld(item="cup", by="paul/hand_r", start=1.0, until=3.0).by 'paul/hand_r'
byis a node path (an entity, or a bone of it) anditeman entity id, both in the shot.offsetis where the item’s centre sits from the carrier’s centre, in scene px; without it, the offset the two have atstartis the one that must hold.untilNoneis the end of the shot. A declaration only: a lint reads it, nothing is composed from it.
- class an.ir.schema.WordTimingIR(*, text, start, end, **extra_data)[source]#
Bases:
_IRModelOne word of a line and when it was spoken, in seconds from the line’s start (like
VisemeKeyframe, never absolute). Stamped by the audio pipeline from the provider’s word timings when it has them (an#96); JSON only —scene.mdnever carries it, the way it never carries visemes.
- class an.ir.schema.World(*, members=<factory>, viewpoints=<factory>, travel=None, frames=<factory>, ground=None, **extra_data)[source]#
Bases:
_IRModelA scene’s world: members at positions, the named viewpoints that are its coverage, and its travel (ADR 0009).
>>> world = World(members=[ ... WorldMember(kind="character", id="jerry", store="characters", ref="jerry", at=(-0.45, 0.65, 1.6), height=1.75), ... WorldMember(kind="prop", id="wheel", store="props", ref="wheel", attached=Attachment(to="jerry")), ... ], viewpoints={"two_shot": Viewpoint(at=(0.0, 0.0, 0.0))}) >>> [m.id for m in world.members], sorted(world.viewpoints) (['jerry', 'wheel'], ['two_shot'])
- all_frames()[source]#
The declared frames plus the one a
travelwith aspeedis sugar for (vehicle, moving along the travel’s direction).>>> World(travel=Travel(speed=4.0)).all_frames()["vehicle"].moving.speed 4.0
- default_frame()[source]#
The frame a member or viewpoint is in when it names none: the travel’s
vehicle(members ride it) when there is one, else the world.>>> World().default_frame(), World(travel=Travel(speed=1.0)).default_frame() ('world', 'vehicle')
- Return type:
- frames: dict[str, Frame]#
The frames of reference,
{name: Frame};worldis the implicit root and a travel with aspeedaddsvehicle.
- ground: float | None#
the world
y(down positive, in theworldframe) of a horizontal plane the members stand on (an#519). Lowering projects it under each positioned member, at that member’s depth, as the floor line thesupportandskatechecks measureb: groundagainst (overrides.ground,an.base.GROUND_OVERRIDE): each frame’s floor as lowered, under where the member stands then, with its place along the floor in the frame it stands in, so a passenger standing still over the world’s floor (its car moving) does not skate. The line is level on the stage (members do not roll with the camera); a member whose handstage.atwins gets none. Unset: no floor in the world, andgroundis the shot’ssolve.groundor where the member stands as the shot opens.- Type:
The floor
- class an.ir.schema.WorldMember(*, kind, id, store, ref, overrides=None, stage=None, library=None, joints=<factory>, at=None, height=None, width=None, units_per_px=None, attached=None, after=None, facing=None, frame=None, planes=None, depths=None, **extra_data)[source]#
Bases:
AssetRefAn entity of the scene’s world: the same reference a shot’s entity carries, at a world position with a size (ADR 0009 decision 1).
>>> m = WorldMember(kind="character", id="paul", store="characters", ref="paul", ... at=(0.45, 0.65, 1.6), height=1.75) >>> m.at, m.height ((0.45, 0.65, 1.6), 1.75)
atis where the entity’s placement point stands (a character’s feet, a prop’s origin) in world units; exactly one ofheight/width(its size in world units) orunits_per_px(world units per native pixel, for art whose extent cannot be measured) sizes it. A member isattachedto another instead of positioned, or it is an environment (present in every framed shot, placed by nothing: plates are per shot).afteris the draw anchor a shot’sstage.afterwould be. A member never carriesstage: the viewpoint places it.- depths: dict[str, float] | None#
An environment’s planes at a depth,
{plane name: z}in world units from the camera along its look direction (an#503): the parallax factor of a plane is DERIVED from it,z_ref / zwithz_refthe depth of the viewpoint’s subject (else of what the shot shows: the character plane), so a plane declares where it is and not how fast it scrolls. A plane with a depth must keep the descriptor’s owndepth(1.0) andparallaxunset: two spellings of one fact are refused. What is at infinity is a plane in afarframe, not a depth.
- facing: float | None#
a yaw in degrees in its own frame, in the convention of a camera’s yaw (0 looks along
+z, positive turns toward+x).None(the default) keeps a billboard: the member has no facing for its kind to answer to. Read byan.genres.EntityKind.view_for(an#734,an.genres.API_LEVEL20), which is handed the camera’s yaw relative to it.- Type:
Where the member faces
- frame: str | None#
The frame of reference this member is in (document key
in); unset means the world’s default frame (World.default_frame()). An environment’sframeis the default of its planes;planesnames the exceptions,{plane name: frame}(one environment can hold a cabin plate and a sky plate).
- an.ir.schema.gravity_vector(spec)[source]#
The acceleration a gravity declaration means, or
Nonefor none.specis how a style pack or a shot spells it:"down 980","down"(DFLT_GRAVITY),"none", a number (down at that strength), or a mapping{strength, direction}(the shape thegravitylint reads).>>> gravity_vector("down 500"), gravity_vector("none"), gravity_vector(None) ((0.0, 500.0), None, None) >>> gravity_vector({"direction": "left"}) (-980.0, 0.0) >>> gravity_vector("sideways") Traceback (most recent call last): ... ValueError: gravity 'sideways': say a direction (down, up, left, right) and an optional strength in px/s², e.g. 'down 980', or 'none'
- an.ir.schema.resolve_step_hz(shot, scene_step_hz)[source]#
The stepped-timing policy
shotrenders under: its ownstep_hzwhen it declares one, else the scene’s, elseNone(smooth). The ONE statement of the shot-over-scene rule — the cutout renderer, the preview and the project renderer all call it (an#89 review: three copies).>>> resolve_step_hz(Shot(id="s", step_hz=10.0), 15.0) 10.0 >>> resolve_step_hz(Shot(id="s"), 15.0) 15.0 >>> resolve_step_hz(Shot(id="s"), None) is None True
- an.ir.schema.stage_specimen(ref)[source]#
A short shot showing the one stage entity
refcasts, on its own (an#347).>>> stage_specimen(AssetRef(kind="prop", id="lamp", store="props", ref="lamp")).entities[0].id 'lamp'
- Return type:
- an.ir.schema.unregistered_action_kind(kind, *, where='')[source]#
The error for an action
kindno loaded genre registered.It names the installed genres whose declaration provides the kind, read without loading them (
an.genres.providers_of()).- Return type: