The For node is used to perform looping operations by allowing one to fire impulses a set amount of times.
Inputs
* (Call)
Begin the for loop.
Count (Int)
The amount of times to trigger LoopIteration
. Will not trigger any iterations if less than 1.
Reverse (Bool)
If True
, the Iteration
output will start at Count - 1
and go down towards 0
.
Outputs
LoopStart (Call)
Fires after *
is pulsed and before any iterations are done. Will be pulsed even if Count < 1
.
LoopIteration (Call)
Fires for each iteration of the loop. This impulse is triggered <count>Count amount of times and the next iteration will only be fired once the current iteration's context is finished.
LoopEnd (Continuation)
Fires after the final LoopIteration
completes execution.
Iteration (Int)
For each LoopIteration
, this output is set to be the index of the iteration for said iteration's context. By default, this will start at 0
and increment until Count - 1
unless Reverse
is True
.
Examples
-
Using the for node to iteratively check if a child slot has the tag 'foo'. and replace it with 'bar' using the Children Count and Get Child nodes.