ForEach
surface node
Repeatedly applies a set of SOPs to the input geometry.
See also: Each
This operator has two main functions:
-
For Each Group/Attribute: Break the input geometry into pieces that correspond to each group or attribute value and run the SOPs on each piece. The result is then merged together to form the output.
-
For Each Number: Repeat the set of SOPs a set number of times, feeding the result of each iteration back to the start.
These effects are achieved with the help of the Each SOP which will handle the culling of the geometry or the acquiring of the feedback geometry. Add new SOPs after the Each SOP inside the subnet.
It is possible to use multiple Each SOPs, or even avoid the Each SOP entirely and use the stamp expression, to achieve more complicated effects.
The ForEach SOP in all cases works with Primitive Groups or Primitive Attributes. Other groups or attributes should first be promoted to Primitive before they can be used. Alternatively, the For Each Number may be used manually performing the For Each Group or For Each Attribute behavior.
Parameters
|
For |
|
||||||
|
Stamp Name |
In each iteration of the For Each SOP, the current value of the iteration will be stamped to this variable. If it is an attribute with vector value, stampnames suffixed with 1, 2, and 3 will be created for the components of the vector. (With default values, this corresponds to FORVALUE1, FORVALUE2, and FORVALUE3) You can use the stamp() expression to get at the value inside the ForEach sop. If it has string value, such as a group value or string attribute value, you can use stamps() to get the value. |
||||||
|
Group Mask |
Any groups that match this pattern in the input geometry will be iterated over in the For Each Group mode. The use of wildcards like “*“ and ”?“ is allowed. |
||||||
|
Attribute |
The name of the primitive attribute to examine for unique values when using For Each Attribute Value. |
||||||
|
Tolerance |
The amount the attribute is allowed to differ but still be considered identical for the purpose of finding unique attributes. This allows small errors in an attribute value from triggering unique passes. |
||||||
|
Number Range |
Specifies the start, end, and increment for processing by each number. The processing is done from the start value up to and including the end value. Each iteration the value increases by the increment. Negative increments are allowed, but in this case the end value has to be below the start value. |
||||||
|
Max Iterations |
Prevents the For Each sop from executing more than the proscribed number of iterations. This is useful as a sanity test for dealing with problematic geometry and as a method of debugging to find out which iteration started to fail. |
||||||
|
Merge Results |
Determines if the output of each round of iteration should be merged together. If not set, only the final round of iteration is used. When doing a For Each Group one will often want to use the Merge Results to collate the separate iterations together. However, if doing a feedback based system, this should be turned off as only the final result is desired. |
Inputs
|
Input to Detect Groups/Attributes From |
When in For Each Group or For Each Attribute mode, the first input is cooked to determine the matching groups or possible attribute values. |
|
Auxiliary Input |
Auxiliary inputs are available to bring additional geometry inside the scope of the For Each SOP. |