colour.utilities.For#

class colour.utilities.For(*args: Any, **kwargs: Any)[source]#

Bases: ControlFlowNode

Define a for loop node for iterating over arrays.

The node iterates over the input port array, setting the index and element output ports at each iteration and calling the colour.utilities.ExecutionNode.process() method of the object connected to the loop_output output port.

Upon completion, the colour.utilities.ExecutionNode.process() method of the object connected to the execution_output output port is called.

Notes

  • The colour.utilities.For loop node does not currently call more than the two aforementioned colour.utilities.ExecutionNode.process() methods, if a series of nodes is attached to the loop_output or execution_output output ports, only the left-most node will be processed. To circumvent this limitation, it is recommended to use a colour.utilities.PortGraph class instance.

Return a new instance of the colour.utilities.TreeNode class.

Parameters:
  • args (Any) – Arguments.

  • kwargs (Any) – Keywords arguments.

__init__(*args: Any, **kwargs: Any) None[source]#
Parameters:
Return type:

None

process() None[source]#

Process the for loop node execution.

Return type:

None