.. _omni_graph_action_ForLoop_1:

.. _omni_graph_action_ForLoop:

.. ================================================================================
.. THIS PAGE IS AUTO-GENERATED. DO NOT MANUALLY EDIT.
.. ================================================================================

:orphan:

.. meta::
    :title: For Loop
    :keywords: lang-en omnigraph node graph:action,flowControl threadsafe action for-loop


For Loop
========

.. <description>

Executes the a loop body once for each value within a range. When step is positive, the values in the range are determined by the formula:
 r[i] = start + step*i, i >= 0 & r[i] < stop.
When step is negative the constraint  is instead r[i] > stop. A step of zero is an error.
 The break input can be used to break out of the loop before the last index.  The finished output is executed after all iterations are complete, or when the loop was broken

.. </description>


Installation
------------

To use this node enable :ref:`omni.graph.action<ext_omni_graph_action>` in the Extension Manager.


Inputs
------
.. csv-table::
    :header: "Name", "Type", "Descripton", "Default"
    :widths: 20, 20, 50, 10

    "Break (*inputs:breakLoop*)", "``execution``", "Breaks out of the loop when the loop body traversal reaches it", "None"
    "In (*inputs:execIn*)", "``execution``", "Input execution", "None"
    "Start (*inputs:start*)", "``int``", "The first value in the range", "0"
    "Step (*inputs:step*)", "``int``", "The step size of the range", "1"
    "Stop (*inputs:stop*)", "``int``", "The limiting value of the range", "0"


Outputs
-------
.. csv-table::
    :header: "Name", "Type", "Descripton", "Default"
    :widths: 20, 20, 50, 10

    "outputs:finished", "``execution``", "Executed when the loop is finished", "None"
    "outputs:index", "``int``", "The current or last index within the range", "None"
    "outputs:loopBody", "``execution``", "Executed for each index in the range", "None"
    "outputs:value", "``int``", "The current or last value of the range", "None"


State
-----
.. csv-table::
    :header: "Name", "Type", "Descripton", "Default"
    :widths: 20, 20, 50, 10

    "state:i", "``int``", "The next position in the range or -1 when loop is not active", "-1"


Metadata
--------
.. csv-table::
    :header: "Name", "Value"
    :widths: 30,70

    "Unique ID", "omni.graph.action.ForLoop"
    "Version", "1"
    "Extension", "omni.graph.action"
    "Icon", "ogn/icons/omni.graph.action.ForLoop.svg"
    "Has State?", "True"
    "Implementation Language", "C++"
    "Default Memory Type", "cpu"
    "Generated Code Exclusions", "tests"
    "tags", "range"
    "uiName", "For Loop"
    "Categories", "graph:action,flowControl"
    "Generated Class Name", "OgnForLoopDatabase"
    "Python Module", "omni.graph.action"

