The authoring model¶
A source answers what is drawn. A layer answers where, when and how it is shown. A composition owns those layers, and a project owns the output settings and root composition. Understanding these relationships makes reuse and later edits predictable.
Place one source twice¶
A Composition is an ordered collection of layers in one local time space.
Higher z values draw over lower values. A Layer supplies a start, duration,
source offset, playback rate, visibility, opacity, transform, blend mode and
attached processing. Its source supplies the content.
For example, place one rectangle source twice:
from vestra import Project, Rectangle
project = Project(
size=(640, 360),
fps=30,
duration=3,
)
panel = Rectangle(width=160, height=80, fill="#2563eb")
left = project.root.add(panel, position=(0.25, 0.5), id="left")
right = project.root.add(panel, position=(0.75, 0.5), id="right")
right.opacity = 0.5
Both rectangles have the same initial geometry. Changing right.opacity affects
only the right placement. Changing panel.fill afterward affects future
placements, because the existing layers already hold copies.
What each placement copies¶
Sources describe images, video, colors, shapes, text, groups, particles and
spectra. Sources do not own a timeline position. Python sources may carry
default transforms, including animation and bindings, which each placement
copies. An add(position=...) override replaces that property's copied state;
other properties keep their defaults.
Copying a file-backed source copies its descriptor and path. It does not create another image, video or font file on disk. Reusing a source therefore creates independent authoring state while still referring to the same media asset.
Use the returned layer for placement edits. For the exact override behavior and practical source examples, see sources and layers.
source ── add(source) ──→ layer A's copy
└─ add(source) ──→ layer B's copy
effect ── layer A.effects.add(effect) ──→ attached effect handle
The original source and effect remain templates for future attachments. Edit the returned layer or attached effect handle to change what is already shown. An audio binding instead records how a property samples a prepared signal; see audio and signals for that evaluation path.
Nested compositions¶
A reusable Group source is copied on placement, including its current children.
composition.group() instead creates a CompositionLayer with an editable
child composition. Both become canonical group content, with local coordinates
and local time. They serve different authoring needs: reusable content versus
ongoing edits to one child composition.
Continue with coordinates and anchors, then groups and nesting to see how placement applies inside a group.
Freeze the authored scene¶
The Python project is mutable while you author it. snapshot() copies and lowers
it to the canonical project model. Validation, preparation and rendering operate
on that snapshot; later edits do not alter an existing snapshot or prepared
runtime. The project also holds the output size, frame rate, duration, background
and audio timeline.
The rendering lifecycle explains when to validate, prepare and render. Use the Python API reference for the explicit snapshot, editor and runtime interfaces.