Skip to main content

cloner

render · 8 properties · Rendering

Draw this node's whole subtree many times over -- along a line, around a ring, or through a grid -- in one call per mesh. The tree, physics and scripts still see one node; seed and random scatter the copies.

In a scene, cloner is the node key that applies it. A script reaches the same properties through node.cloner.get() and node.cloner.set(table).

Properties

propertytypedefaultdescription
anglefloat0Degrees between copies on a ring; zero closes the ring evenly
countint4How many copies, when mode is linear or radial At least 1.
countsvec3[3,1,3]How many along each axis, when mode is grid
modeenumlinearHow the copies are laid out One of linear, radial, grid.
radiusfloat2How far out the ring sits, when mode is radial
randomfloat0How far a copy may wander in position, turn and size Range 0–1.
seedint0The seed the scatter runs off; zero scatters nothing At least 0.
stepvec3[1,0,0]The gap between copies, when mode is linear or grid

Script functions

Methods of node.cloner, the handle a node carrying this component exposes. Each is also a free function on its module, taking the node as its first argument. Every handle also has get(), set(table), has() and remove().

From render:

methodwhat it does
clones() -> anyWhere the node's cloner puts each copy, in the node's own space, as #{ position, rotation, scale }; an empty list when the node has no cloner. What a bake-to-nodes command spawns from.