Describing where and when it happens: the values#

The enumerations and values of this group, each the word an author writes.

PLACES#

Import

from scenet import PLACES

Defined in

scenet.places (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

scenet.places.PLACES: dict[Place, tuple[Mass, ...]]#

What each place is made of, as the masses a setting: {place: ...} expands into.

Every entry here is a plain mass list, and a test proves it: whatever a preset produces, an author could have typed. The expansion happens in the frontend, so nothing downstream ever sees a place.

Example

>>> from scenet import PLACES, Place
>>> [mass.kind.value for mass in PLACES[Place.DOCKS]]
['sky', 'building', 'water', 'structural', 'ground']

See also

Place, the names it is keyed by. Mass, what each entry lists.

Fit#

Import

from scenet import Fit

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.12

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Fit[source]#

Bases: StrEnum

How a supplied picture fills the panel, keeping its own proportions.

Fit

The picture

SVG’s word

cover

Fills the panel; what overhangs it is cropped, equally on both sides

slice

contain

Is shown whole; the panel shows round it where their shapes differ

meet

Centred either way. A picture is never stretched: its shape is a fact about it, and a figure drawn into it would be stretched with it.

Example

>>> from scenet import Fit, SettingSpec
>>> SettingSpec(image="art/street.png", fit="contain").fit is Fit.CONTAIN
True

See also

SettingSpec, whose fit takes one.

COVER = 'cover'#
CONTAIN = 'contain'#

Horizon#

Import

from scenet import Horizon

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Horizon[source]#

Bases: StrEnum

Where the ground meets whatever is behind it.

One line for the whole panel, which every mass is composed against: masses of the ground sort start at it and run down, masses that stand in the world rise from it. Named rather than given as a number for the same reason at: is – the author is saying how the panel is composed, not typing a coordinate.

Example

>>> from scenet import Horizon, SettingSpec
>>> SettingSpec(horizon="low").horizon is Horizon.LOW
True

See also

SettingSpec, whose horizon takes one. Mass, which is composed against it.

HIGH = 'high'#
MID = 'mid'#
LOW = 'low'#
property fraction: float#

Where the line sits, as a fraction of panel height.

A high horizon sits nearer the top of the frame, so more ground is in view and the camera reads as looking down over it.

Example

>>> from scenet import Horizon
>>> Horizon.HIGH.fraction < Horizon.LOW.fraction
True

MassKind#

Import

from scenet import MassKind

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.MassKind[source]#

Bases: StrEnum

What a tonal mass in the backdrop is made of.

Subsetted from the supercategories of COCO-Stuff, the canonical taxonomy of stuff – “amorphous background regions” as opposed to things with a well-defined shape. Its own argument is that stuff classes explain scene type and the geometric properties of a scene, which is exactly the job here. Taken from an existing vocabulary for the same reason the predicates were taken from Visual Genome.

Deliberately not the leaf names. COCO-Stuff’s actual classes are building-other, sky-other, wall-brick, water-other and so on, where the -other suffix marks the catch-all inside a supercategory. building-other is not a word anyone should have to type.

Seven are outdoor – building, ground, plant, sky, solid, structural, water – and five indoor: ceiling, floor, furniture, wall, window. COCO-Stuff’s own indoor/outdoor split is where that distinction comes from, so it did not have to be invented either. Its textile, food and rawmaterial supercategories are left out: drapery and objects, not scene-defining masses.

A kind decides the shape a mass takes, never its value. Value comes from the plane, which is what keeps the notan reading honest – see Plane.

Example

>>> from scenet import Mass, MassKind
>>> Mass(kind="wall").kind is MassKind.WALL
True

See also

Mass, whose kind takes one.

BUILDING = 'building'#
CEILING = 'ceiling'#
FLOOR = 'floor'#
FURNITURE = 'furniture'#
GROUND = 'ground'#
PLANT = 'plant'#
SKY = 'sky'#
SOLID = 'solid'#
STRUCTURAL = 'structural'#
WALL = 'wall'#
WATER = 'water'#
WINDOW = 'window'#

Place#

Import

from scenet import Place

Defined in

scenet.places (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.places.Place[source]#

Bases: StrEnum

A named setting, expanded into masses by the frontend.

Ten to start with, chosen to span the distinctions that change how a backdrop is built rather than to be a catalogue: exterior and interior, built and natural, open and enclosed. alley is the one with a foreground mass, which is what makes it read as a place you are standing in rather than looking at.

Example

>>> from scenet import PLACES, Place
>>> [mass.kind.value for mass in PLACES[Place.SHORE]]
['sky', 'water', 'ground']

See also

PLACES, what each place expands into. SettingSpec, whose place takes one.

ALLEY = 'alley'#
DESERT = 'desert'#
DOCKS = 'docks'#
FIELD = 'field'#
FOREST = 'forest'#
MOUNTAIN = 'mountain'#
OFFICE = 'office'#
ROOM = 'room'#
SHORE = 'shore'#
STREET = 'street'#

Plane#

Import

from scenet import Plane

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Plane[source]#

Bases: StrEnum

How far back a mass sits, which decides both its draw order and its value.

Four planes, ordered from the back of the panel forward. They map onto the existing integer CoreActor.depth painter’s order rather than introducing a second ordering mechanism: the three backdrop planes take negative depths, and foreground takes one above the frontmost actor, so a foreground mass draws over the cast the way a silhouetted doorway does.

Value follows from the plane and from nothing else, which is what makes the aerial perspective rule parametric: with distance, contrast drops toward the atmosphere. Reading front to back, a mass never gets darker. See tone_for.

Example

>>> from scenet import Mass, Plane
>>> Mass(kind="building", plane="far").plane is Plane.FAR
True

See also

Mass, whose plane takes one.

FOREGROUND = 'foreground'#
NEAR = 'near'#
MID = 'mid'#
FAR = 'far'#

Spans#

Import

from scenet import Spans

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Spans[source]#

Bases: StrEnum

How much of the panel’s width a mass covers.

Resolved to an extent in the frontend, and that is not cosmetic. Any construct that would reintroduce a left/right disjunction has to resolve it before the solver, because Cassowary cannot express “A left of B or B left of A”. A span is an absolute extent rather than a relation, which is what stops masses becoming an unordered beside.

Example

>>> from scenet import Mass, Spans
>>> Mass(kind="building", spans="left").spans is Spans.LEFT
True

See also

Mass, whose spans takes one.

FULL = 'full'#
LEFT = 'left'#
CENTRE = 'center'#
RIGHT = 'right'#
property fractions: tuple[float, float]#

The extent as (start, end) fractions of panel width.

left and right overlap slightly in the middle. Butting them exactly would leave a seam down the centre of the panel wherever both are used at the same plane, which reads as a mistake rather than as two masses.

Example

>>> from scenet import Spans
>>> Spans.FULL.fractions
(0.0, 1.0)

TimeOfDay#

Import

from scenet import TimeOfDay

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.TimeOfDay[source]#

Bases: StrEnum

When the panel happens, which shifts the whole value ladder.

Each time supplies two numbers – the value of the foreground and the value of the atmosphere – and the planes are spaced evenly between them. So night is not a blue filter over a daytime panel: it is a darker, more compressed ladder, which is what night actually does to a drawn scene. The ladder stays monotonic in depth at every time of day, by construction rather than by tuning.

Example

>>> from scenet import SettingSpec, TimeOfDay
>>> SettingSpec(time="night").time is TimeOfDay.NIGHT
True

See also

SettingSpec, whose time takes one.

DAWN = 'dawn'#
DAY = 'day'#
DUSK = 'dusk'#
NIGHT = 'night'#

TypeSize#

Import

from scenet import TypeSize

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.11

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.TypeSize[source]#

Bases: StrEnum

How large a line of dialogue is lettered, against the panel’s dialogue size.

Dark Horse lists “(small), (burst), and (weak)” among the common indications for modified lettering. Blambot, Small Dialogue / Big Balloon: “A reduced font size is used when a character mutters something, says something to him/herself, or speaks sheepishly” – smaller type, in the room the balloon would have had.

Example

>>> from scenet import TypeSize, compile_source
>>> def size(text):
...     source = "cast: {a: {reference: alice}}\nscript: [{say: " + text + "}]"
...     return compile_source(source).core.balloons[0].font_size
>>> size("{by: a, text: mm., size: small}") < size("{by: a, text: mm.}")
True
>>> TypeSize("small") is TypeSize.SMALL
True

See also

SayEvent, whose size takes one. LetteringSpec, the panel’s own dialogue size.

NORMAL = 'normal'#
SMALL = 'small'#

Weather#

Import

from scenet import Weather

Defined in

scenet.ir (source)

Install

pip install scenet

Since

0.6

Stability

Public: follows semantic versioning. Below 1.0, a minor release may change it, and the CHANGELOG says how.

class scenet.ir.Weather[source]#

Bases: StrEnum

What the air is doing between the reader and the panel.

clouds and fog are first-class stuff in COCO-Stuff, so this vocabulary did not have to be invented either. fog renders as a turbulence veil over the backdrop; rain and snow add that veil as cloud and put falling marks over everything, because weather is between the reader and the figures rather than behind them.

Example

>>> from scenet import SettingSpec, Weather
>>> SettingSpec(weather="rain").weather is Weather.RAIN
True

See also

SettingSpec, whose weather takes one.

CLEAR = 'clear'#
RAIN = 'rain'#
FOG = 'fog'#
SNOW = 'snow'#