Archived docs Get your API Key
Get started
Tutorials
Guides
Reference
Help for coding agents
๐Ÿค– AI Assistant

Repeating scenes

A scene can be repeated once per item of an array variable, so one authored scene becomes many rendered ones: a card per product, a slide per speaker, a room per room. The underlying movie JSON property is iterate.

Setting it up

Select the scene and open the Repeat (iterate) group in the properties panel:

The Repeat group on a scene that has no array variable yet

  1. Pick the array variable to repeat over. The picker lists only the movie's array variables and shows how many items each one holds. A dotted path such as product.images can be typed directly.
  2. The panel reports how many copies the scene will produce.
  3. Optionally narrow the range with From, To and Step. From is inclusive, To is exclusive, both are 1-based, and negative values count back from the end of the array. These fields appear only once the scene repeats.

If the movie has no array variable yet โ€” the state in the screenshot above โ€” the panel says so and offers Create an array variable, which takes you to the schema editor with the new variable ready to define.

Referring to the current item

Inside a repeated scene, each item's own fields are available as variables. For an array like this:

{
  "variables": {
    "products": [
      { "name": "Blue mug",  "price": "$12" },
      { "name": "Red mug",   "price": "$14" }
    ]
  }
}

โ€ฆa text element in the repeated scene can simply write {{name}} and {{price}}. Three extra variables describe the position in the loop:

Variable Value
{{iteration}} The index of the current copy
{{first_iteration}} True on the first copy
{{last_iteration}} True on the last copy

The Inspector panel resolves all of these at the playhead, so you can see exactly which item the copy under the playhead is showing.

What it looks like in the Editor

The outline keeps showing one row โ€” the scene you authored โ€” with a badge carrying the number of copies. The timeline shows the copies as separate blocks, grouped under a band naming the array, and labels each one after the authored scene: Scene 2 ยท 2/3.

Selecting any copy selects the authored scene, because that is the thing you can actually edit. Editing it changes every copy.

Three ways a repeat produces nothing

A repeated scene can silently vanish from the movie. The Editor badges the scene in a warning colour when this happens, but it is worth knowing the causes:

  • The array is empty. No items, no copies, no scene.
  • The array holds plain values, not objects. ["a", "b"] produces zero copies. Items must be objects โ€” [{ "value": "a" }, { "value": "b" }] works.
  • A condition on the scene evaluates to false. The scene is removed from the rendered movie.

None of the three is an error, and none of them fails the render โ€” the movie simply comes out shorter than expected.

Conditions

A scene can also carry a condition, which decides whether it renders at all. The Editor flags a conditioned scene with an icon in the outline and keeps it fully visible and editable โ€” a scene you cannot see is a scene you cannot fix.

Repeating a single element

iterate is editable from the Editor on scenes. To repeat an individual element rather than a whole scene, write the property in the JSON view.

See also