Difference between revisions of "For (LogiX node)"
Line 19: | Line 19: | ||
| style="background-color:{{Int-color}}" | | | style="background-color:{{Int-color}}" | | ||
| Count | | Count | ||
− | | [[:Category:Types: | + | | [[:Category:Types:Int|Integer]] |
|} | |} | ||
Revision as of 00:21, 5 September 2020
The For node fires impulses from LoopInteration equal to the number of iterations specified by the Count input. For the duration of the impulse chain started by each LoopIteration impulse the Iteration value is equal to the iteration number. An impulse is fired from LoopStart before iterations begin and from LoopEnd after iterations have completed.
Inputs & Outputs
Color | Label | Type |
Run | Impulse | |
Count | Integer |
Color | Label | Type |
LoopStart | Impulse | |
LoopIteration | Impulse | |
LoopEnd | Impulse | |
Iteration | Integer |
Usage
Neos uses zero indexing, hence the Iteration value for the first impulse fired from LoopImpuse is zero. Iteration values will increase up to Count - 1. All iterations for this node complete within a single frame update - if this does not complete within the time normally taken for a frame update it produces visible framerate hitches. There is a timeout which puts this node into an error state (visual turns red) if it delays an update excessively to prevent complete freezes.
Examples
The For node is extremely useful for looping a known number of times. If similar looping behavior is required, but the number of required iterations cannot be determined prior to starting the loop, consider using the While node.