#usda 1.0
(
    "This file is a contrived schema file."
    subLayers = [
        @baseSchema.usda@
    ]
)

over "GLOBAL" (
    customData = {
        string libraryName      = "usdContrived"
        string libraryPath      = "pxr/usd/usdContrived"
        # string libraryPrefix  = "Usd"
        # string tokensPrefix   = "Usd"
        dictionary libraryTokens = {
            dictionary libraryToken1 = {}
            dictionary libraryToken2 = {
                string value = "/non-identifier-tokenValue!"
                string doc = """libraryToken2 doc"""
            }
        }
    }
)
{
}

class "NonAppliedAPI" (
    inherits = </APISchemaBase>
    customData = {
        token apiSchemaType = "nonApplied"
    }
)
{
}

class "SingleApplyAPI" (
    inherits = </APISchemaBase>
    customData = {
        token apiSchemaType = "singleApply"
        bool isPrivateApply = false
    }
)
{
}

class "EmptyMultipleApplyAPI" (
    inherits = </APISchemaBase>
    customData = {
        token apiSchemaType = "multipleApply"
    }
)
{
}


class "MultipleApplyAPI" (
    inherits = </APISchemaBase>
    customData = {
        token apiSchemaType = "multipleApply"
        bool isPrivateApply = true
        token propertyNamespacePrefix  = "test"
    }
)
{
    int testAttrOne
    double testAttrTwo
}

class "DerivedMultipleApplyAPI" (
    inherits = </MultipleApplyAPI>
    customData = {
        token apiSchemaType = "multipleApply"
        token propertyNamespacePrefix = "derived"
    }
)
{
    int testAttrThree
}

class "PublicMultipleApplyAPI" (
    inherits = </APISchemaBase>
    customData = {
        token apiSchemaType = "multipleApply"
        token propertyNamespacePrefix  = "testo"
    }
)
{
    int testAttrOne
    double testAttrTwo
}

class "Base" (
    inherits = </Typed>
    doc = "This doc should only exist on the \"Base\" class."
    customData = {
        dictionary schemaTokens = {
            dictionary schemaToken1 = {}
            dictionary schemaToken2 = {
                string value = "/non-identifier-tokenValue!"
                string doc = """schemaToken2 doc"""
            }
        }
    }
) {
    
    token myVaryingToken = "VariableTokenDefault" (
        allowedTokens = ["VariableTokenAllowed1", "VariableTokenAllowed2", ""]
        doc = "VariableToken attribute docs.")
    
    uniform token[] myVaryingTokenArray = ["VariableTokenArrayAllowed1", ""] (
        allowedTokens = [
            "VariableTokenArrayAllowed1",
            "VariableTokenArrayAllowed2",
            ""]
        doc = "VariableTokenArray attribute docs.")
    
    uniform bool myUniformBool = false (
        doc = "Uniform bool, default false")
        
    # Validating that we DO want to support custom schema properties 
    # even in Typed schemas!
    custom double myDouble

    # Validate all scene description types
    bool bool = true

    uchar uchar = 0
    int int = 0
    uint uint = 0
    int64 int64 = 0
    uint64 uint64 = 0

    half half = 0.0
    float float = 0.0
    double double = 0.0
    
    string string = "string"
    token token = "token"
    asset asset = @asset@

    int2 int2 = (0, 0)
    int3 int3 = (0, 0, 0)
    int4 int4 = (0, 0, 0, 0)

    half2 half2 = (0, 0)
    half3 half3 = (0, 0, 0)
    half4 half4 = (0, 0, 0, 0)
    
    float2 float2 = (0, 0)
    float3 float3 = (0, 0, 0)
    float4 float4 = (0, 0, 0, 0)

    double2 double2 = (0, 0)
    double3 double3 = (0, 0, 0)
    double4 double4 = (0, 0, 0, 0)

    point3h point3h = (0.0, 0.0, 0.0)
    point3f point3f = (0.0, 0.0, 0.0)
    point3d point3d = (0.0, 0.0, 0.0)

    vector3d vector3d = (0, 0, 0)
    vector3f vector3f = (0, 0, 0)
    vector3h vector3h = (0, 0, 0)

    normal3d normal3d = (0, 0, 0)
    normal3f normal3f = (0, 0, 0)
    normal3h normal3h = (0, 0, 0)

    color3d color3d = (0, 0, 0)
    color3f color3f = (0, 0, 0)
    color3h color3h = (0, 0, 0)

    color4d color4d = (0, 0, 0, 0)
    color4f color4f = (0, 0, 0, 0)
    color4h color4h = (0, 0, 0, 0)

    quatd quatd = (1, 0, 0, 0)
    quatf quatf = (1, 0, 0, 0)
    quath quath = (1, 0, 0, 0)

    matrix2d matrix2d = ( (1, 0), (0, 1) )
    matrix3d matrix3d = ( (1, 0, 0), (0, 1, 0), (0, 0, 1) )
    matrix4d matrix4d = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )

    frame4d frame4d = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1) )

    bool[] boolArray

    uchar[] ucharArray
    int[] intArray
    uint[] uintArray
    int64[] int64Array
    uint64[] uint64Array

    half[] halfArray
    float[] floatArray
    double[] doubleArray

    string[] stringArray
    token[] tokenArray
    asset[] assetArray

    int2[] int2Array
    int3[] int3Array
    int4[] int4Array

    half2[] half2Array
    half3[] half3Array
    half4[] half4Array

    float2[] float2Array
    float3[] float3Array
    float4[] float4Array

    double2[] double2Array
    double3[] double3Array
    double4[] double4Array

    point3h[] point3hArray
    point3f[] point3fArray
    point3d[] point3dArray

    vector3h[] vector3hArray
    vector3f[] vector3fArray
    vector3d[] vector3dArray

    normal3h[] normal3hArray
    normal3f[] normal3fArray
    normal3d[] normal3dArray

    color3h[] color3hArray
    color3f[] color3fArray
    color3d[] color3dArray

    color4h[] color4hArray
    color4f[] color4fArray
    color4d[] color4dArray

    quath[] quathArray
    quatf[] quatfArray
    quatd[] quatdArray

    matrix2d[] matrix2dArray
    matrix3d[] matrix3dArray
    matrix4d[] matrix4dArray

    frame4d[] frame4dArray
}

class Derived "Derived" (
    inherits = </Base>
    doc = """\\em Emphasized! \\section Test_Section Test Section"""
) {

    float3 pivotPosition = (0, 0, 0) (
         doc = """Rotation pivot position for this prim's transformation. 
         Provided as advisory data only for use by authoring applications,
         and should have no effect on the transformation encoded in the
         'transform' attribute.""")

    float3[] myVecfArray
    
    int[] holeIndices = [] (
        doc = """The face indices (indexing into the 'faceVertexCounts'
        attribute) of all faces that should be made invisible.""")

    int[] cornerIndices = [] (
        doc = """The vertex indices of all vertices that are sharp corners.""")

    float[] cornerSharpnesses = [] (
        doc = """The sharpness values for corners: each corner gets a single
        sharpness value (Usd.Mesh.SHARPNESS_INFINITE for a perfectly sharp
        corner), so the size of this array must match that of
        'cornerIndices'""")

    int[] creaseLengths = [] (
        doc = """The length of this array specifies the number of creases on the
        surface. Each element gives the number of (must be adjacent) vertices in
        each crease, whose indices are linearly laid out in the 'creaseIndices'
        attribute. Since each crease must be at least one edge long, each
        element of this array should be greater than one.""")

    matrix4d transform = ((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)) (
        doc = """Double-precision transformation matrix, which should encode
        the entire local transformation for a prim.""")
         
    rel binding (
        doc = """This is my awesome relationship."""
    )

    asset[]  testingAsset

    float namespaced:property = 1.0

    token justDefault = "newToken" (
        doc = """newToken should be included in the global token set.""")
}

class TestPxHairman "TestPxHairman" (
    inherits = </Typed>
    customData = {
        string className = "TestHairman"
        dictionary extraPlugInfo = {
            string extraInfo = "ExtraInfo"
        }
    }
)
{
    custom float temp
    float riStatements:attributes:user:Gofur_GeomOnHairdensity (
        doc = """This exercises custom API naming."""
        customData = {
            string apiName = "Gofur_GeomOnHairdensity"
        }
    )

    rel relCanShareApiNameWithAttr (
        doc = """This exercises custom API naming."""
        customData = {
            string apiName = "Gofur_GeomOnHairdensity"
        }
    )

    float attrWithoutGeneratedAccessorAPI (
        doc = """This exercises empty apiName to skip accessor generation."""
        customData = {
            string apiName = ""
        }
    )
}
