Replicator COMP
Summary
The Replicator Component creates a node for every row of a table, creating and deleting nodes ("replicants") as the table changes.
It takes the node specified in the Master Node parameter, and for every row in the Template Table, makes a copy of the master.
The nodes that are created can be named in two ways. Copies can be named/numbered sequentially using
the prefix specified by the Node Prefix parameter: item1, item2, ... Alternately, copies can be named based on the string in a column of the table, specified with the Name from Table parameter.
If you want to create a node for the first row of the table, un-set the Ignore First Row parameter.
The replicants get laid out in a grid in the network, determined by the Layout and Layout Origin parameters.
The Replicator does not assume or require that the master and replicants are components – they can all be Movie In TOPs if you want. It also does not assume or require that the replicants are clones. However the Master Node can be a component whose Clone parameter is set to itself, so that all nodes created are clones of the master.
For every replicant, you can run a script in the Script parameter to customize it relative to the master, such as setting the Display or Clone parameters, or a Render flag.
If only one line of a table changes, the other existing replicants are not changed or re-created.
This is an extremely powerful node type. Examples: a button gadget for each row of the table. a geometry component, which is replicated at every point of a 3D particle system, each behaving separately. You can feed the table of a Multi Touch In DAT directly to the Replicator to create something at each fingertip.
Example File : File:Replicator examples.tox
Parameters - Replicator Page
Template Table /template - Path to the table DAT that will drive the replicating.
Name from Table /namefromtable - How the node names will be generated.
- Row Index: Uses the Node Prefix parameter followed by the row number. The default creates nodes named
item1,item2,item3.... (The top row is 0). - Column by Index: The node name is in the column specified by a column number.
- Column by Name: The node name is in a column specified by a column name in the first row.
Ignore First Row /ignorefirstrow - Do not create a node for the first row.
Column Name /colname - Name at the top of the column.
Column Index /colindex - Column number, starting from 0.
Node Prefix /nodeprefix - Add this prefix to all nodes.
Master Node /master - Which node or component to replicate.
Location /location - Where to put the replicant nodes. If the location is .., it puts the nodes inside the parent, which is actually alongside the Replicator component. If you put ., it will put it inside itself, that is, inside the Replicator component. If left blank, it will error.
Maximum Nodes /maxnodes - Max number of nodes, to keep it under control.
Script /script - Runs the script command to customize the replicants versus the master. Some local variables are defined:
- $ITEM Name of current node being replicated.
- $MASTER Name of master node.
- $LOCATION Name of the location component.
The most common need is for the master to not display, and the replicants to display. For Panel components it is most commonly "opparm $ITEM paneldisplay ( 1 )", and for Geometry components it is most commonly "opset -d on $ITEM". Use the popup menu for some common scripts.
Layout /layout - How to lay out the new nodes - all in one place (Off), horizontally, vertically, or in a grid.
Layout Origin /layoutorigin1, layoutorigin2 - Where to lay out the new nodes, giving the XY location of the top-left node's bottom-left corner.
Re-create All Nodes /recreateall - Deletes all nodes it has created, then re-creates them using the template and its current parameters.
Parameters - Common Page
Node View /tileview - what is displayed in the Node Viewer.
- Network Viewer - displays the component's internal network in the viewer.
- Parameters - displays the component's parameters in the viewer.
- Operator Viewer - displays the viewer of the operator referenced in the Operator Viewer parameter below.
Operator Viewer /opviewer - path to the operator used when the Node View parameter is set to Operator Viewer.
Clone /clone - path to a Master Clone for this component.
Path Variable /pathvar - set the name of a Path Variable for this component.
| ||||||||||||||
