#usda 1.0
(
    customLayerData = {
        dictionary cameraSettings = {
            dictionary Front = {
                double3 position = (0, 0, 50000)
                double radius = 500
            }
            dictionary Perspective = {
                double3 position = (500.0000000000001, 500.0000000000001, 499.9999999999998)
                double3 target = (0, 0, 0)
            }
            dictionary Right = {
                double3 position = (-50000, 0, -1.1102230246251565e-11)
                double radius = 500
            }
            dictionary Top = {
                double3 position = (-4.329780281177466e-12, 50000, 1.1102230246251565e-11)
                double radius = 500
            }
            string boundCamera = "/OmniverseKit_Persp"
        }
        dictionary omni_layer = {
            dictionary muteness = {
            }
        }
        dictionary renderSettings = {
        }
    }
    defaultPrim = "World"
    endTimeCode = 100
    metersPerUnit = 0.01
    startTimeCode = 0
    timeCodesPerSecond = 24
    upAxis = "Y"
)

def Xform "World"
{
    def DistantLight "defaultLight" (
        prepend apiSchemas = ["ShapingAPI"]
    )
    {
        float angle = 1
        float intensity = 3000
        float shaping:cone:angle = 180
        float shaping:cone:softness
        float shaping:focus
        color3f shaping:focusTint
        asset shaping:ies:file
        double3 xformOp:rotateXYZ = (315, 0, 0)
        double3 xformOp:scale = (1, 1, 1)
        double3 xformOp:translate = (0, 0, 0)
        uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]
    }

    def GlobalComputeGraph "ActionGraph"
    {
        def ComputeGraphSettings "computegraphSettings"
        {
            custom token evaluator:type = "execution"
            custom int2 fileFormatVersion = (1, 2)
            custom token flatCacheBacking = "Shared"
            custom token pipelineStage = "pipelineStageSimulation"
        }

        def ComputeNode "script_node"
        {
            custom double inputs:data
            prepend double inputs:data.connect = </World/ActionGraph/constant_double.inputs:value>
            custom uint inputs:execIn
            prepend uint inputs:execIn.connect = </World/ActionGraph/on_impulse_event.outputs:execOut>
            custom double inputs:multiplier = 2
            custom int outputs:asInt = 0
            custom float state:asFloat = 0
            custom string inputs:script = '''"""
Test Script
"""
# output is multiplied by dynamic attrib defined in the USD
db.outputs.data = db.inputs.data * db.inputs.multiplier
db.outputs.asInt = int(db.outputs.data)
db.state.asFloat = float(db.outputs.asInt)
'''
            custom token node:type = "omni.graph.scriptnode.ScriptNode"
            custom int node:typeVersion = 1
            custom double outputs:data
            custom uint outputs:execOut
        }

        def ComputeNode "constant_double"
        {
            custom double inputs:value = 42
            custom token node:type = "omni.graph.nodes.ConstantDouble"
            custom int node:typeVersion = 1
        }

        def ComputeNode "on_impulse_event"
        {
            custom token node:type = "omni.graph.action.OnImpulseEvent"
            custom int node:typeVersion = 1
            custom uint outputs:execOut
            custom bool state:enableImpulse
        }
    }
}

