I’ve run across an odd result of composition with usd-23.08 which I can’t explain. Given the following layer:
#usda 1.0
class "_class_"
{
class "asset"
{
class "representations"
{
class "modelHero" (
variants = {
string lookdev = "v2"
}
prepend variantSets = "lookdev"
)
{
def "geo"
{
def "foo"
{
}
}
variantSet "lookdev" = {
"v2" {
def "mtl"
{
def Material "myMaterial"
{
}
}
}
}
}
}
}
}
def Xform "element" (
variants = {
string mode = "foo"
}
prepend variantSets = "mode"
)
{
variantSet "mode" = {
"foo" (
prepend specializes = </_class_/asset/representations/modelHero>
) {
}
}
}
In the composed stage, the modelHero
prim has the mtl/myMaterial
prim as expected but the element
prim does not.
Using Inherits instead of Specializes gives the expected result but causes strength ordering issues in other places. Adding an indirection between element
and modelHero
by specializing a different prim which then specializes modelHero also gives the expected result weirdly.
I believe this might have something to do with how Specializes arcs are ignored while recursing but I can’t wrap my head around why the specialize partially works but ignores the “lookdev=v2” variant completely.
Can anyone explain what’s happening here? Is this intended behaviour or is it a bug?