I am looking at instancing workflows and have a few questions about embedding references into prototype prims.
My prototype has a breakdown sublayer where assets are placed for layout to arrange/build a more complex assembly from. This is all good it seems. My question is about references being pathed (we don’t have an asset resolver at the moment) vs just embedding a path to prim that points to the reference on disk.
breakdown.usda
def Xform "root"
{
def Xform "prop"
{
def Xform "keyboardA01" (
instanceable = true
prepend references = @/asset/job/prop/keyboardA/components/model/usdCache/default/v001/entry.usda@
)
{
}
def Xform "mouseA01" (
instanceable = true
prepend references = @/asset/job/prop/mouseA/components/model/usdCache/default/v001/entry.usda@
)
{
}
}
}
What I’ve seen is that most approaches will encode the full path in the prototype prim but does it have to be this way? I swaped the absolute paths to the prim path that is fed from the breakdown sublayer and it works fine. Is this bad practice? Is there reasons not to do this?
layout.usda
#usda 1.0
(
endTimeCode = 1
framesPerSecond = 24
metersPerUnit = 1
startTimeCode = 1
timeCodesPerSecond = 24
upAxis = "Y"
)
def Xform "root" (
kind = "group"
)
{
def Xform "layout" (
kind = "group"
)
{
def Scope "Prototypes" (
kind = "group"
)
{
token visibility = "invisible"
def "root"
{
def "prop"
{
def Xform "mouseA01" (
instanceable = true
prepend references = @/asset/job/prop/mouseA/components/model/usdCache/default/v001/entry.usda@
)
{
}
def Xform "keyboardA01" (
instanceable = true
prepend references = @/asset/job/prop/keyboardA/components/model/usdCache/default/v001/entry.usda@
)
{
}
}
}
}
def "instance0" (
instanceable = true
prepend references = </root/layout/Prototypes/root/character/horseA01>
)
{
matrix4d xformOp:transform:instancer1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-500, 0, -500, 1) )
uniform token[] xformOpOrder = ["xformOp:transform:instancer1"]
}
def "instance1" (
instanceable = true
prepend references = </root/layout/Prototypes/root/character/maleA01>
)
{
matrix4d xformOp:transform:instancer1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-479.5918273925781, 0, -500, 1) )
uniform token[] xformOpOrder = ["xformOp:transform:instancer1"]
}
}
}
becomes (compare: /root/layout/Prototypes)
#usda 1.0
(
endTimeCode = 1
framesPerSecond = 24
metersPerUnit = 1
startTimeCode = 1
timeCodesPerSecond = 24
upAxis = "Y"
)
def Xform "root" (
kind = "group"
)
{
def Xform "layout" (
kind = "group"
)
{
def Scope "Prototypes" (
kind = "group"
)
{
token visibility = "invisible"
def "root"
{
def "prop"
{
def Xform "mouseA01" (
instanceable = true
*prepend references = </root/prop/mouseA01/>
)
{
}
def Xform "keyboardA01" (
instanceable = true
prepend references = </root/prop/keyboardA01/>
)
{
}
}
}
}
def "instance0" (
instanceable = true
prepend references = </root/layout/Prototypes/root/character/horseA01>
)
{
matrix4d xformOp:transform:instancer1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-500, 0, -500, 1) )
uniform token[] xformOpOrder = ["xformOp:transform:instancer1"]
}
def "instance1" (
instanceable = true
prepend references = </root/layout/Prototypes/root/character/maleA01>
)
{
matrix4d xformOp:transform:instancer1 = ( (1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (-479.5918273925781, 0, -500, 1) )
uniform token[] xformOpOrder = ["xformOp:transform:instancer1"]
}
}
}
Is this a dumb approach? We have a mechanism for building our sublayer stack on the fly and some other stuff but if the answer is “asset resolver” then that is good to know!
Composition doesn’t seem to have a problem with method but I am no expert on the nuance of USD and I am curious what pitfalls we will run into?
Thanks I hope this wasn’t a dumb question!