|On this page|
The Solver SOP is a much more straightforward solution for iteratively applying a SOP network to geometry.
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.
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.
If you nest ForEach SOPs (including nesting in assets), you need to change the stamp names.
Determines all primitive groups that match the group mask found in the input geometry. Runs the contained SOPs once for each group with the stamp set to the name of the group.
Each Attribute Value
For the given primitive attribute, determines how many unique values it has in the input geometry. Runs the contained SOPs for each unique attribute value with the stamp set to the value of the attribute. The Tolerance is used to determine what is considered unique.
Runs the contained SOPs once for each number in the given number range. If the number range is invalid, runs a zero number of times.
Runs the contained SOPs once for each primitive in the first input with the stamp set to the primitive number.
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.
Stamp Index Name
The current foreach pass will be stamped into this variable. The stamp passes start at 0.
Any groups that match this pattern in the input geometry will
be iterated over in the For Each Group mode. The use of
? is allowed.
The name of the primitive attribute to examine for unique values when using For Each Attribute Value.
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.
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.
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.
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.
Apply to Points
Instead of applying the foreach loop to primitive group, primitive attribute, or primitive numbers, it is applied to point groups, point attributes, or point numbers.
If you do this with Merge Results you will lose all primitives because only the points are extracted with the underlying Each SOP. This is very similar to what the Copy SOP does with the Template Point Group, the Foreach SOP just makes this more explicit.
This parameter is evaluated after stamping the new value, but before performing the iteration. If it is one, the looping is stopped. If it is zero, it continues.
If the stop condition causes no iterations to be performed, the input geometry is copied directly.
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 inputs are available to bring additional geometry inside the scope of the For Each SOP.