SettingSpec#

Import

from scenet import SettingSpec

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.SettingSpec[source]#

Bases: Strict

Where and when the panel happens: tonal masses, or a picture drawn elsewhere.

There is no `place` field here, deliberately. place: docks is surface syntax that the frontend expands into exactly the mass list an author could have written themselves – the same treatment alice left_of bob gets, which reaches the IR as a Relation and never as text. That is what keeps a preset a library for convenience rather than a second, opaque format: by the time anything downstream sees a backdrop, there is one representation of it.

A panel with no masses and clear weather has no backdrop at all, which is what every panel written before this block existed still gets.

Example

>>> from scenet import SettingSpec, parse_panel
>>> panel = parse_panel("setting: {place: docks, time: night}")
>>> isinstance(panel.setting, SettingSpec)
True
>>> panel.setting.time.value, len(panel.setting.masses) > 0
('night', True)

See also

Mass, one shape in it. Place, a setting by name.

horizon: Horizon#

Where the ground meets what is behind it, which every mass is composed against: high shows more ground, low less.

masses: tuple[Mass, ...]#

The backdrop as tonal masses, back to front: what a place expands into, written out. Write this, place or image, never two of them.

time: TimeOfDay#

When the panel happens, which sets the two ends of the value ladder: the foreground’s value and the atmosphere’s.

weather: Weather#

What the air is doing: fog veils the backdrop; rain and snow veil it as cloud, and fall over everything, the cast included.

image: str | None#

A picture drawn elsewhere, behind the cast: a PNG or JPEG file, relative to the document. Only its size is read. Written instead of place and masses.

fit: Fit | None#

How the picture fills the panel: cover fills it and crops what overhangs, equally on both sides; contain shows the whole picture. Left out, cover.

property is_bare: bool#

Whether there is nothing to draw: no masses, no picture, nothing in the air.