The Panel Core types#
The types a compile returns, read off result.core and book.pages. They are not in scenet.__all__: import one from scenet.core to annotate with it. What each field means is in the Panel Core reference.
Blob#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
Box#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.Box[source]#
Bases:
CoreModelA rectangle, as stored in a Core document.
The serialisable twin of
BBox. The geometry code works inBBox; this is what gets written to JSON, with every value already rounded so the file is byte-identical across platforms.
Capsule#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
CoreActor#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreActor[source]#
Bases:
CoreModelOne character, fully resolved: placed, posed, scaled and measured.
This is the geometric contract in its final form. Everything the emitter needs to draw the figure, and everything the balloon placer needed to avoid it, with no reference to artwork of any kind.
- reference#
Which puppet was used, as the cast names it: a shipped puppet’s name, or a puppet file’s path relative to the document, exactly as written. Two actors may share one.
- Type:
- anchors#
Named attachment points –
mouth,eyes, and whatever else the puppet declared – already in panel coordinates.
- gaze#
Unit direction the character is facing,
(dx, dy). Derived from the head’s rotation, and what balloon placement reads to keep out of a line of sight.
- gaze_aim#
Unit direction from the eyes to whoever this character is
looking_at, or None when they are looking at nobody. Separate fromgazebecause it is known only after every actor has been placed, and because balloon placement must go on reading the same vector it always has. This is what aims the pupils.
- face_marks#
The drawn face – brows, eyes, pupils, nose, mouth – as resolved numeric primitives. Empty when the puppet declares no features, or when the figure is too small for features to read as anything but a smudge.
- Type:
tuple[FaceStroke|FaceDisc|FaceStroke|FaceDisc,...]
- emanata#
The marks drawn around the character, as the same strokes and discs a face is made of. Empty when there are no marks, or when the figure is too small to have a face. Ids are numbered per mark:
plewd_0,plewd_1, …- Type:
tuple[FaceStroke|FaceDisc|FaceStroke|FaceDisc,...]
- emanata_zones#
One polygon per mark, enclosing what it draws. Balloons and captions pay to cover these and are never forbidden to. Kept apart from
hullon purpose: the hull is what staging spaces characters by, and a character who starts sweating must not move.
- joints#
Where every joint of the skeleton landed, by the puppet’s name for it, in panel coordinates.
_land_rare the sides of the screen in the puppet’s rest pose, so on a figure facing leftshoulder_lis on the right. Nothing here draws from them; they are the posed skeleton, for an export.
- features#
Where each face feature point sits –
eye_l,nose,mouthand the rest the puppet declares – in panel coordinates. The anatomy, not the marks: the same whatever the expression, and recorded when the face is too small to draw.
- looking_at#
Whom this character looks at: an actor id, or the name of somebody heard from off panel.
gaze_aimis the direction; this is who.
The last three are left out of the JSON when empty, so an actor written before them reads and writes as it did.
CoreAtmosphere#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreAtmosphere[source]#
Bases:
CoreModelWhat the air is doing, resolved.
- time#
When the panel happens. Recorded rather than re-derived, for the same reason
CoreCaption.italicis: the emitter must not be able to draw something the solver did not resolve.- Type:
- streaks#
Rain, every streak at the same angle.
- Type:
- fall_tone#
What rain and snow are drawn in – ink over a bright sky, paper over a dark one. Resolved rather than left to the emitter, because which one reads is a fact about this panel.
- Type:
- colour#
The atmosphere’s tone in the panel’s palette. Left out of the JSON when there is none.
- Type:
CoreBackdrop#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreBackdrop[source]#
Bases:
CoreModelWhere the panel is, resolved: masses, tones, the air, or a supplied picture.
- horizon#
Where the ground meets what is behind it, in panel units. Left out over a supplied picture, whose horizon the compiler does not know.
- seed#
What every silhouette in here was generated from. Kept so that a Core document explains itself: two panels with the same masses and different skylines differ here, and here is where to look.
- Type:
- atmosphere#
The air, or None when the weather is clear.
- Type:
- image#
The supplied picture behind everything, or None. Left out of the JSON when unset.
- place#
The named place these masses are –
street,docks– whetherplace:wrote them or an author wrote the same list out. None for masses no place expands into, and over a picture. A name for what is here, never read to draw it. Left out of the JSON when None.
- time#
The hour the values were chosen for, which
atmosphererecords too but only when something is in the air. None over a picture, whose hour is in the picture. Left out of the JSON when None.
Optional on
PanelCore, so every document written before this existed is still a valid one – which is why adding it did not need aformat_versionbump, the same argument captions made.imageand a missinghorizonare additions of the same kind: a backdrop of masses reads and writes byte for byte as it did.
CoreBalloon#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreBalloon[source]#
Bases:
CoreModelOne balloon, placed and with its lettering already broken into lines.
- speaker#
Actor id of whoever is talking – or, when
off_panelis set, the name of somebody off panel, who is not an actor.- Type:
- kind#
Which sort of balloon to draw.
- Type:
- runs#
For a line with emphasis, the line cut wherever its face changes, so each run is drawn in the face it was measured in. Empty when no line has any – and then left out of the JSON, so a balloon without emphasis reads and writes exactly as it did before emphasis existed.
linesstays the plain text.
- label#
Who says it, how, and the words –
Bob, whispering: I know.– as accessible output reads it. Left out of the JSON when unset.
- off_panel#
The side of the frame an off-panel speaker is on, which the tail ends on; then
speakernames somebody who is not an actor. Left out of the JSON when unset, so every Core written before it reads, and is written, as it was.
Storing broken lines rather than the original string is deliberate. Wrapping is decided during compilation against real font metrics; if the emitter re-measured, it could disagree with the solver about how wide the balloon needed to be, and the text would overflow the shape drawn for it.
CoreCamera#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreCamera[source]#
Bases:
CoreModelThe camera’s verdict for a panel, recorded.
Every position in a Core already follows from it, so nothing here is read to draw the panel; it says what framed it. The shot asked for and the angle are what a reader of the panel would name; the numbers are what the solver made of them.
- angle#
The camera’s height, which changed the headroom and nothing else.
- Type:
- reference#
The puppet the shot was composed on, as the cast names it: the
referenceof the member written first.- Type:
- headroom#
The air above the reference actor’s head, as a fraction of the panel’s height.
- Type:
CoreCaption#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreCaption[source]#
Bases:
CoreModelOne caption box, placed and with its lettering already broken into lines.
- order#
Position in the panel’s reading order. Captions and balloons share one sequence, so a caption written between two lines of dialogue takes the number between theirs.
- Type:
- kind#
What the box is doing, which is what decides how it is set.
- Type:
- lines#
The resolved line breaking, quotation marks included. A
spokencaption’s quotes are part of the text by the time it reaches here, because marks added after measurement would not fit the box drawn for them.
- italic#
Whether the lettering is set in the italic face. Recorded rather than re-derived from
kindso the emitter cannot draw the box in a face the solver did not measure it in.- Type:
- ink#
The value the lettering is drawn in. Chosen against
fillby contrast, so a dark box is lettered in paper – reversed type. Resolved rather than left to the emitter for the same reasonitalicis, and the same reasonCoreAtmosphere.fall_toneis: which mark reads is a fact about the panel.- Type:
- speaker#
Who is talking, for a
spokencaption. Not an actor id: the speaker is off panel, so this resolves to nobody inactors.
- runs#
For a line with emphasis, the line cut wherever its face changes, exactly as on
CoreBalloon. Left out of the JSON when empty.
- label#
What the box says, and in whose voice –
Caption: Midnight.– without the quotation marks aspokencaption is lettered with. Left out of the JSON when unset.
- colour#
The fill’s twin in the panel’s palette: a
warmcaption’s yellow, drawn in place offillwhen there is one.fillstays the value, andinkwas chosen against it. Left out of the JSON when there is none.- Type:
There is no tail. That is the difference that makes this its own type rather than a fifth
BalloonKind.fillandinkare defaulted to the white and the near-black every caption has had since captions shipped, so a Core document written before tones existed is still a valid one – which is why adding them needed noformat_versionbump.
CoreFigure#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreFigure[source]#
Bases:
CoreModelA figure a supplied picture draws, as its artwork contract declares it.
Not a
CoreActor: nobody posed it, so it has no transform, no skeleton and nothing to draw – the picture draws it. What is here is what lettering worked around, in panel units, mapped from the picture’s pixels through the same fit as the picture’sbox.- actor#
The cast member it plays, or None for a figure nobody cast – whose face lettering kept clear of just the same. Left out of the JSON when None.
- mouth#
Where a tail it speaks aims, if the contract declares one; otherwise the face’s centre. Left out of the JSON when None.
CoreFont#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreFont[source]#
Bases:
CoreModelA font file the lettering was measured in, named by what is in it.
- sha256#
The digest of the file’s bytes. A renderer is handed fonts by this, and refuses to draw a panel whose fonts it was not handed: lettering drawn in a face it was not measured in would not fit the balloons drawn for it.
- Type:
Never a path. Where the file was is a fact about one machine, and a Core is the same wherever it was compiled.
CoreFrame#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreFrame[source]#
Bases:
CoreModelWhere one panel sits on a page.
- panel#
The panel’s name, as
panels:gives it. Its own Panel Core is a separate document, compiled at exactly this width and height.- Type:
- clearance#
For an inset, the area it covers with its ring of white, in page units: painted white under it, and kept clear by its parent’s lettering. Left out of the JSON otherwise.
- outline#
For a panel in a slanted tier, its four corners in page units, clockwise from the top left; the frame is their bounding box. Left out of the JSON for a rectangle.
CoreGlyph#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
CoreImage#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreImage[source]#
Bases:
CoreModelA supplied picture behind the cast, placed.
Everything a renderer needs, resolved: where the picture is, what it is, and the rectangle it is drawn in. Nothing about its content – the solver never saw any.
- href#
The path exactly as the document wrote it, relative to the document. A linked SVG points at the picture by it; nothing else about where the file was reaches the output.
- Type:
- media_type#
image/pngorimage/jpeg, from the file’s own bytes – what adata:URI of it is labelled.- Type:
Literal['image/png','image/jpeg']
- sha256#
The digest of its bytes, which is what it is known by: an embedding renderer is handed bytes by digest, and refuses a Core naming bytes it was not given, as it refuses a font.
- Type:
- preserve_aspect_ratio#
The same fit in SVG’s words,
xMidYMid sliceforcoverandxMidYMid meetforcontain. Recorded rather than derived, asCoreCaption.italicis: the emitter copies it.boxalready has the picture’s proportions, so a renderer that reads them as the compiler did draws the same either way; this says what to do to one that does not.- Type:
Literal['xMidYMid slice','xMidYMid meet']
- box#
Where the picture is drawn, in panel units: centred, larger than the panel under
coverand cropped by it, inside it undercontain. Change it and the picture moves.- Type:
CoreMass#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreMass[source]#
Bases:
CoreModelOne tonal mass of the backdrop, resolved to a numeric polygon.
The same discipline as
capsules,blobsandface_marks: everything the emitter needs is a number by the time it gets here, so drawing a backdrop involves no layout decision at all.- kind#
What the mass is made of. Carried so a Core document stays readable – it is not consulted when drawing, since the tone is already resolved. The depth export reads it: the sky is at infinity, and a ground, floor, water or ceiling recedes.
- Type:
- depth#
Painter’s order, shared with the actors. Backdrop planes are negative; a foreground mass sits above the frontmost actor.
- Type:
- tone#
The
#rrggbbfill, already chosen from the value ladder. Always the grey, whatever the palette: it is the value, and every decision was made on it.- Type:
CoreRun#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
CoreSfx#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreSfx[source]#
Bases:
CoreModelOne sound effect, placed, with every letter resolved.
- order#
Its number in the panel’s one reading order, which it shares with balloons and captions. It is exempt from the geometric reading-order rule: a sound sits where the sound is.
- Type:
- glyphs#
Every letter: where it starts, and how far it is turned. The arc and the rotation are already in these numbers, so the emitter decides nothing.
- zone#
What the letters cover, outline included: the polygon balloons and captions paid to avoid, and which no face was allowed inside.
CoreStreak#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreStreak[source]#
Bases:
CoreModelOne streak of falling rain.
The width is on
CoreAtmosphererather than here: every streak in a panel shares it, and repeating it per streak would make the file longer without making it say anything more.
CoreVeil#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.CoreVeil[source]#
Bases:
CoreModelThe atmospheric noise layer, as parameters rather than as pixels.
SVG has Perlin noise built in through
feTurbulence, and the specification includes reference code, so a fixedseedis reproducible by definition: the emitted text is byte-identical. Browsers agree only approximately on what to paint from it, which is fine and is exactly why the determinism contract is on the SVG text and has never been on pixels.
Disc#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.Disc[source]#
Bases:
CoreModelA circle, as stored in a Core document.
Usually a face exclusion zone – the region no balloon may cover. Also a fleck of falling snow, which is the same shape and wants the same rounding.
FaceDisc#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
FaceStroke#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.FaceStroke[source]#
Bases:
CoreModelOne line of a drawn face, already sampled into straight segments.
Curves are sampled during compilation rather than emitted as Bezier control points, so that everything an expression does is a number here. A face can then be read, diffed and hand-adjusted exactly like the rest of this tier, and the emitter has nothing left to decide.
Tail#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |
- class scenet.core.Tail[source]#
Bases:
CoreModelThe pointer from a balloon to its speaker’s mouth.
controlis present only when the straight route was obstructed and the tail had to bend, which keeps the common case honest about being a simple straight line.- end: tuple[float, float]#
Its point, at the speaker’s mouth, or on the frame for a speaker off panel.
Transform#
Import |
|
Defined in |
|
Stability |
Returned, not exported: its fields are the Panel Core format’s, and change only as the format says, under |