#usda 1.0
(
    doc = """Simulation Dependency Test"""
    metersPerUnit = 1
    upAxis = "Y"
)
def Xform "defaultPrim"
{
    def ComputeNode "time"
    {
        custom token node:type = "omni.graph.test.Time"
        custom int node:typeVersion = 1
        custom double outputs:time
        custom double outputs:frame
        custom double outputs:fps
        custom double outputs:elapsedTime
    }
    def Scope "changingData"
    {
        # This is the initial value of "a".
        int[] a = [0]
        
        # This connection is used to update the value of "a" from the
        # computed results.
        int[] a.connect = <../graph/addEveryTime.outputs:output>
        
        # This connection to time is just to mark this prim's data
        # dirty on every frame.  This probably won't be necessary
        # once we have another explicit way to demarcate the beginning
        # and end of an iteration.
        double time.connect = <../time.outputs:elapsedTime>
    }
    def Scope "unchangingData"
    {
        int[] b = [-2]
    }
    def Scope "alsoUnchangingData"
    {
        int[] c.connect = <../graph/addOnce.outputs:output>
    }
    def Scope "graph"
    {
        def ComputeGraphSettings "computegraphSettings"
        {
            custom token evaluator:type = "dirty_push"
        }
        
        # This node should run only once, since its inputs
        # aren't marked dirty on every frame.
        def ComputeNode "addOnce"
        {
            custom token node:type = "omni.graph.nodes.Add2IntegerArrays"
            int node:typeVersion = 1
            
            int[] inputs:a = [3]
            int[] inputs:b.connect = <../../unchangingData.b>
            
            int[] outputs:output
        }
        
        # This node should re-run every frame, since "changingData"
        # is marked dirty on every frame, and this node's
        # "inputs:a" has a connection to it.
        def ComputeNode "addEveryTime"
        {
            custom token node:type = "omni.graph.nodes.Add2IntegerArrays"
            int node:typeVersion = 1
            
            int[] inputs:a.connect = <../../changingData.a>
            int[] inputs:b.connect = <../addOnce.outputs:output>
            
            int[] outputs:output
        }
    }
}
