all  /  test_assets  / foundation  / stage_composition  / references_prim  / reference_prim_in_same_file .usda

References prim

These files show how to reference prims directly.

References prim in other file

screenshot reference_prim_in_other_file.usda, usdrecord 22.08

reference_prim_in_other_file.usda contains three prim references in other files:

  • Cube_with_reference references an existing mesh
  • Cube_invalid_reference references a non existing mesh in a valid file
  • Cube_invalid_file_reference references an non existing mesh in an invalid file

References prims in same file

screenshot reference_prim_in_same_file.usda, usdrecord 22.08

reference_prim_in_same_file.usda contains two prim references within the same file:

  • Cube_with_reference references an existing mesh
  • Cube_with_invalid_reference references an non existing mesh

Edit this page

reference_prim_in_same_file.usda

#usda 1.0
(
    customLayerData = {
        string copyright = "Copyright 2022 Apple Inc. All rights reserved."
    }
    defaultPrim = "World"
    upAxis = "Y"
    metersPerUnit = 0.01
)

def Scope "World"
{
    def Cube "Cube"
    {
    }

    def "Cube_with_reference" (
        references = </World/cube>
    )
    {
        color3f[] primvars:displayColor = [(0.8, 0, 0)]
        double3 xformOp:translate = (3, 0, 0)
        uniform token[] xformOpOrder = ["xformOp:translate"]
    }

    def "Cube_with_invalid_reference" (
        references = </World/cube_does_not_exist>
    )
    {
        color3f[] primvars:displayColor = [(0.8, 0, 0)]
        double3 xformOp:translate = (6, 0, 0)
        uniform token[] xformOpOrder = ["xformOp:translate"]
    }
}