Reference

Layer References

Beyond sublayers, layers can also be grafted underneath prims. Using the example Cube and Sphere from Local/Sublayer, we can also create prims and have them point to these layers respectively.

Layer referencing

reference_1 reference_2

Local References

While the general use-case is to use layers when referencing, it is not required to do so. It is entirely possible to add a reference to a prim within the same layer. This is known as a local reference

Local referencing

reference_3 reference_4

You would merely need to add a reference to the target prim and its entire hierarchy will be grafted underneath:

def "ReferenceToFoo"(
        prepend references=</foo>
) {
}

Layer Prim References

But, this goes even further! Remember, composition acts on layer stacks, not individual layers; so it is also possible to reference specific prims from another layer’s layer stack. Even if these prims themselves are the composed result from the target layer’s layer stack

Layer Prim referencing

reference_5 reference_6

def "ReferenceToPrim"(
    prepend references= @./several_prims.usd@</A_Capsule>
) {
    float3 xformOp:translate = (3, 0, 0)
    uniform token[] xformOpOrder = ["xformOp:translate"]
}