Difference between revisions of "For (LogiX node)"
(Add info about when the count input is evaluated) |
(Marked this version for translation) |
||
Line 21: | Line 21: | ||
+ | <!--T:6--> | ||
The <code>Reverse</code> input controls whether the <code>Iteration</code> output value is incremented or decremented each <code>LoopIteration</code>. Default is False, meaning <code>Iteration</code> is incremented each iteration. | The <code>Reverse</code> input controls whether the <code>Iteration</code> output value is incremented or decremented each <code>LoopIteration</code>. Default is False, meaning <code>Iteration</code> is incremented each iteration. | ||
+ | <!--T:7--> | ||
The <code>LoopStart</code> output fires an impulse once after an impulse is received at <code>Run</code>. The impulse chain will complete before any impulses are fired from <code>LoopIteration</code>. | The <code>LoopStart</code> output fires an impulse once after an impulse is received at <code>Run</code>. The impulse chain will complete before any impulses are fired from <code>LoopIteration</code>. | ||
+ | <!--T:8--> | ||
The <code>LoopIteration</code> output fires impulses sequentially until the total number which have been fired is equal to the <code>Count</code> input. Each impulse chain started from <code>LoopIteration</code> completes before the following one is fired. | The <code>LoopIteration</code> output fires impulses sequentially until the total number which have been fired is equal to the <code>Count</code> input. Each impulse chain started from <code>LoopIteration</code> completes before the following one is fired. | ||
+ | <!--T:9--> | ||
The <code>LoopEnd</code> output fires an impulse once the final impulse chain started from <code>LoopIteration</code> has ended. | The <code>LoopEnd</code> output fires an impulse once the final impulse chain started from <code>LoopIteration</code> has ended. | ||
+ | <!--T:10--> | ||
The <code>Iteration</code> output value is either incremented or decremented each time a new impulse is fired from <code>LoopIteration</code>, depending on the value of <code>Reverse</code>. If <code>Reverse</code> is False, <code>Iteration</code> is incremented each time an impulse is fired from <code>LoopIteration</code> starting with the value 0, during the first iteration, and ending with <code>Count</code> - 1 on the final iteration. If <code>Reverse</code> is True, the <code>Iteration</code> value is <code>Count</code> - 1 on the first iteration and decremented each time down to 0 on the final iteration. | The <code>Iteration</code> output value is either incremented or decremented each time a new impulse is fired from <code>LoopIteration</code>, depending on the value of <code>Reverse</code>. If <code>Reverse</code> is False, <code>Iteration</code> is incremented each time an impulse is fired from <code>LoopIteration</code> starting with the value 0, during the first iteration, and ending with <code>Count</code> - 1 on the final iteration. If <code>Reverse</code> is True, the <code>Iteration</code> value is <code>Count</code> - 1 on the first iteration and decremented each time down to 0 on the final iteration. | ||
+ | <!--T:11--> | ||
Note that all impulse chains started from this node effectively continue the one which arrived at <code>Run</code>, meaning that any temporary values from previous nodes are still available. All iterations from <code>LoopIteration</code> complete within a single frame update and therefore this can produce framerate hitches if an excessively demanding computation is performed. There is a failsafe which will put this node into an error state (node visual turns red) if a frame is delayed excessively - this helps prevent complete freezes. | Note that all impulse chains started from this node effectively continue the one which arrived at <code>Run</code>, meaning that any temporary values from previous nodes are still available. All iterations from <code>LoopIteration</code> complete within a single frame update and therefore this can produce framerate hitches if an excessively demanding computation is performed. There is a failsafe which will put this node into an error state (node visual turns red) if a frame is delayed excessively - this helps prevent complete freezes. | ||
Revision as of 09:11, 12 February 2022
For | ||
---|---|---|
Inputs | ||
Impulse | Run | |
Int | Count | |
Bool | Reverse | |
Outputs | ||
Impulse | LoopStart | |
Impulse | LoopIteration | |
Impulse | LoopEnd | |
Int | Iteration |
The For node is used to fire impulses from the LoopIteration
output a specific number of times when an impulse is received at Run
.
Usage
The Count
input determines how many times impulses will be fired from the LoopIteration
output. Default is 0. Note that this is evaluated immediately after the LoopStart
impulse chain has completed, just before any impulses are fired from LoopIteration
.
The Reverse
input controls whether the Iteration
output value is incremented or decremented each LoopIteration
. Default is False, meaning Iteration
is incremented each iteration.
The LoopStart
output fires an impulse once after an impulse is received at Run
. The impulse chain will complete before any impulses are fired from LoopIteration
.
The LoopIteration
output fires impulses sequentially until the total number which have been fired is equal to the Count
input. Each impulse chain started from LoopIteration
completes before the following one is fired.
The LoopEnd
output fires an impulse once the final impulse chain started from LoopIteration
has ended.
The Iteration
output value is either incremented or decremented each time a new impulse is fired from LoopIteration
, depending on the value of Reverse
. If Reverse
is False, Iteration
is incremented each time an impulse is fired from LoopIteration
starting with the value 0, during the first iteration, and ending with Count
- 1 on the final iteration. If Reverse
is True, the Iteration
value is Count
- 1 on the first iteration and decremented each time down to 0 on the final iteration.
Note that all impulse chains started from this node effectively continue the one which arrived at Run
, meaning that any temporary values from previous nodes are still available. All iterations from LoopIteration
complete within a single frame update and therefore this can produce framerate hitches if an excessively demanding computation is performed. There is a failsafe which will put this node into an error state (node visual turns red) if a frame is delayed excessively - this helps prevent complete freezes.