colour.utilities.For#
- class colour.utilities.For(*args: Any, **kwargs: Any)[source]#
Bases:
ControlFlowNodeDefine a
forloop node for iterating over arrays.The node iterates over the input port
array, setting theindexandelementoutput ports at each iteration and calling thecolour.utilities.ExecutionNode.process()method of the object connected to theloop_outputoutput port.Upon completion, the
colour.utilities.ExecutionNode.process()method of the object connected to theexecution_outputoutput port is called.Notes
The
colour.utilities.Forloop node does not currently call more than the two aforementionedcolour.utilities.ExecutionNode.process()methods, if a series of nodes is attached to theloop_outputorexecution_outputoutput ports, only the left-most node will be processed. To circumvent this limitation, it is recommended to use acolour.utilities.PortGraphclass instance.
Return a new instance of the
colour.utilities.TreeNodeclass.