Houdini 20.5 Nodes Geometry nodes

Block End geometry node

The end/output of a looping block.

On this page
Since 14.5

This node defines the end of a looping node block.

See looping in geometry networks for general information on how to use this node with the Block Begin SOP node.

Repetition mode vs. piecewise mode

This node will present different parameters in the Parameter Editor based on whether or not it is working on pieces. A piece is usually a series of primitives that have the same piece or name partition attribute. The piece attribute name is set by the Piece Attribute parameter on this node.

The Block End SOP is in piecewise mode when:

  • The Interation Method parameter on this node is set to Auto Detect from Inputs, and either the Block Begin SOP node that is referenced in by the Piece Block Path parameter is set to Method ▸ Extract Piece or Point, or the second input of the node is connected.

  • The Interation Method parameter on the node is set to By Pieces or Points.

When this node is in piecewise mode, it will show parameters related to pieces, and you do not need to set the number of iterations because it will automatically iterate over each piece.

The Block End SOP is in repetition mode when:

  • None of the piecewise mode conditions are met.

  • The Interation Method parameter on the node is set to By Count.

When this node is in repetition mode, it will show parameters allowing you to set the number of iterations.

Parameters

Iteration Method

Determines how the input geometry is iterated on.

Auto Detect from Inputs

If a second input is present on the node, the Interation Method ▸ By Pieces or Points method is used across the input geometry. Similarly, if the Piece Block Path is defined, then the By Pieces or Points method is used across the node’s input. If neither of these are the case, then the By Count method is used.

By Pieces

One iteration is performed for each piece in the input geometry. If no input geometry is wired into the node, then an error will be issued.

By Count

A fixed number of iterations are performed according to the Iterations parameter.

Gather Method

Determines what is done with the results of a loop iteration.

Feedback Each Iteration

Outputs the geometry from the last iteration of the loop. You can use this with the Method ▸ Fetch Feedback setting on the Block Begin SOP node to have the loop accumulate geometry at each step and then output the end result.

Merge Each Iteration

Records the geometry from each iteration and then merges them together at the end. You can use this with the method ▸ Extract Piece or Point setting on the Block Begin SOP node to have the loop modify only one piece at a time and then merge all the pieces together at the end.

Note

If you use Extract Piece or Point for each iteration and gather the results using this method, then the point and primitive numbers will be renumbered to be contiguous within their piece.

Iterations

Sets the number of times to cook the loop. This parameter is only available when Iteration Method is set to By Count.

Start Value

Specifies the value of the value metadata attribute on the first iteration. See the looping documentation for how to use this parameter. This parameter is only available when Iteration Method is set to By Count.

Increment

Specifies the amount to add to the value metadata attribute after each iteration. See the looping documentation for how to use this parameter. This parameter is only available when Iteration Method is set to By Count.

Piece Elements

Determines whether to loop over primitives or points. This parameter controls whether the piece attribute is a point or primitive attribute. This parameter is only available when in piecewise mode.

Piece Attribute

When on, specifies the name of the partition attribute that defines the pieces, where each point or primitive (depending on the current Piece Elements parameter setting) with the same attribute value is considered part of the same piece. Partition attributes can only be integers or strings. If a Piece Attribute is not provided, then the node will loop over every point or primitive on the input. This parameter is only available when in piecewise mode.

Note

Several tools (for example, like the Shatter shelf tool) create this type of attribute for you.

Max Iterations

When on, specifies the maximum number of iterations that are allowed. This can be useful for testing and debugging. You can also use this parameter to guard against huge input geometry when in piecewise mode.

Default Block Path

Specifies the path to the Block Begin SOP node that starts this node’s loop.

Note

When the number of Iterations is 0, then this node will output this Block Begin SOP’s input.

Piece Block Path

Specifies the path to the Block Begin SOP node from which to get the pieces. Alternatively, you can connect the geometry that contains the pieces to this node’s second input. Either method switches this node to piecewise mode.

Reset Cached Pass

After cooking, this node caches the output of its loop’s last iteration. This allows you debug the last iteration by moving the display flag around inside the loop. This button clears that cache, and until the node cooks again, this node will show its initial state.

Single Pass

When on, runs a single iteration at the given offset. This is useful for debugging piecewise loops and showing the output of an individual piece/iteration.

Stop Condition

If this parameter is 1 at the start of an iteration, then looping of the block stops. As such, you can add an expression to this parameter to test various conditions. For example, you could set a threshold for the number of polygons in a feedback loop.

When the stop condition triggers before the first iteration of a loop, then it is as if Max Iterations was set to 0 and the node outputs the input of the Block Begin SOP node specified by the Default Block Path parameter.

Multithread when Compiled

When on, if this node’s For-Loop is inside of a compiled block, then it may be possible to run each pass on a separate thread if this node has Gather Method ▸ Merge Each Iteration selected and no Feedback inputs. If these conditions are met, then you can create a separate task for each pass to allow singlethreaded operations to use multiple cores.

Note

If the operations in this node’s loop are already multithreaded, then there may be little gain from using this parameter and the overhead of starting tasks may even make it slower. Likewise, if the operations are very fast, then it may take longer to setup tasks than is gained. In particular, this parameter is usually only needed to multithread the outermost of a set of For-Loops.

Inputs

Input 1

Nodes to Iterate Over. This network chain will be re-evaluated at each iteration. Upstream Block Begin SOP nodes will be dirtied on each pass.

Input 2

Geometry Pieces to Loop Over. A source for pieces to iterate over. Alternatively, you can use the Piece Block Path parameter to specify the source (which should be a Block Begin SOP node set to Method ▸ Extract Piece or Point).

Examples

NumbersOnPoints Example for Block End geometry node

This node shows how to stamp numbers onto points. It uses a for-each loop to iterate over each point, and the metadata source to get the current iteration number.

SimpleFeedback Example for Block End geometry node

This shows how to re-apply the same sequence of nodes multiple times to geometry using the for-loops.

SwissCheese Example for Block End geometry node

This node shows how to iterate over all the pieces of one geometry to consecutively subtract volumes from an original geometry.

See also

Geometry nodes