Scene
Type: object
A scene is a distinct, sequential segment of the movie. Scenes play in the order they appear in the parent movie's scenes array. Scenes cannot overlap in time. Each scene holds its own elements, optional transition, and local variables.
Properties
background-color
Background color of the scene. Hexadecimal value (e.g. #FF0000) or transparent.
| Type | string |
| Required | No |
| Default Value | "#000000" |
cache
If true, a previously rendered version of this scene is reused when its inputs match. If false, the scene is rendered from scratch.
| Type | boolean |
| Required | No |
| Default Value | true |
comment
Free-form note attached to the scene. Ignored by the renderer.
| Type | string |
| Required | No |
condition
Expression evaluated at render time. The scene is included only if the expression is truthy. Empty strings and falsy values cause the scene to be skipped.
| Type | string |
| Required | No |
duration
Scene duration in seconds. -1 makes the scene as long as needed to contain all its elements.
| Type | number |
| Required | No |
| Default Value | -1 |
| Format | float |
elements
Elements rendered inside the scene. Stacking order in the array determines layering — later items render on top.
| Type | array |
| Required | No |
Array items
Each item is one of the element types defined in Element. The discriminator is the type field.
type value |
Schema |
|---|---|
image |
Image element |
video |
Video element |
text |
Text element |
html |
HTML element |
component |
Component element |
audio |
Audio element |
voice |
Voice element |
audiogram |
Audiogram element |
subtitles |
Subtitles element |
id
Unique identifier for the scene. Auto-generated when omitted.
| Type | string |
| Required | No |
| Default Value | "@randomString" |
import
ID of another scene to import. Imported scenes are merged into the current scene by appending their elements array. Useful with templates.
| Type | string |
| Required | No |
iterate
Name of a movie-level variable holding an array of objects. Before expressions are evaluated, the scene is duplicated once per array item. Each item's own fields are added to the copy's local variables as flat names — an item { "name": "Kitchen" } is read as {{ name }}, not {{ item.name }} — together with three automatic variables:
iteration— 1-based counter, incremented once per visited array position.first_iteration—trueon the copy for the first position of the range.last_iteration—trueon the copy for the last position of the range.
Used to generate slideshow-style sequences from data.
Dot notation reaches an array nested inside an object variable, e.g. "product.images". The path is walked from the movie's variables until an array is found.
| Type | string |
| Required | No |
Things worth knowing:
iteratealso works on elements, both insidescene.elementsand in the movie-levelelementsarray — not just on scenes.- Array items that are not objects produce no copy. An array of plain strings or numbers (
["a", "b"]) expands to zero scenes, and the scene disappears from the movie with no error. Mixed arrays still advance theiterationcounter for the skipped positions, so the counter is not necessarily consecutive. - An empty array removes the scene from the movie entirely.
- A variable that is missing, or that does not resolve to an array, fails the render with
"iterate" property in scene #N does not point to an array variable in global variables. - Every copy keeps the template's
id. All copies of a scene share the same identifier, so anidcannot be used to address one specific iteration. - There is no
iterate-asproperty and noitemscope; adding one fails withProperty 'iterate-as' is not allowed. last_iterationnever fires wheniterate-stepskips the final position. With 10 items and"iterate-step": 2the last copy is item 9, not item 10, so no copy is flagged as last.- Iterating a whole array has no practical limit. Sub-ranges do: when
iterate-from/iterate-toselect fewer than 100 items, iteration stops at array position 100, so a narrow range beginning past position 100 of a long array produces no copies at all.
iterate-from
First array item to iterate, 1-based and inclusive. A negative value counts from the end of the array (-2 is the second-to-last item). Values of 0 or lower are treated as 1. Must be lower than iterate-to, otherwise the render fails with iterate-from must be lower than iterate-to. Only used when iterate is set.
| Type | number |
| Required | No |
| Default Value | 1 |
iterate-step
Number of array items to advance between iterations — 2 takes every other item. Values lower than 1 are treated as 1. Only used when iterate is set.
| Type | number |
| Required | No |
| Default Value | 1 |
iterate-to
Last array item to iterate, 1-based and exclusive: the item at this position is not included. Defaults to one past the end of the array, so the whole array is iterated. A negative value counts from the end of the array. Only used when iterate is set.
For example, "iterate-from": 2 with "iterate-to": 5 renders items 2, 3 and 4.
| Type | number |
| Required | No |
preload
Assets to fetch or generate before this scene's elements render. Same shape as movie.preload.
| Type | array |
| Required | No |
transition
Transition between this scene and the next.
| Type | object |
| Required | No |
This object contains the following properties:
- type: (string, optional) — Transition family. Currently
xfade. Defaultxfade. - style: (string, optional) — Transition style. Default
fade. Examples:fade,wipeleft,slideup,circleopen,dissolve,pixelize, … - duration: (number, optional) — Length of the transition in seconds.
variables
Scene-local variables. Names follow the same rules as movie.variables. Local variables override parent (movie) values inside the scene.
| Type | object |
| Required | No |
| Default Value | {} |