Relocates removes prim path

I’m not sure if this is a bug or not. I’m using USD 24.8 and am hitting this issue where an entire prim path seems to go missing when I use relocates.

If I have a relocates that is as simple as

#usda 1.0
(
    upAxis="Y"
    metersPerUnit=0.1
    defaultPrim="Root"

    relocates = {
        </Root/FirstChild>: </Root/Relocated>
    }

)

def Xform "Root" (
) {

    def Xform "FirstChild" () {
        int age = 34
    }

}

When I flatten I get

#usda 1.0
(
    defaultPrim = "Root"
    doc = """Generated from Composed Stage of root layer /Users/dhruvgovil/Projects/core-spec-supplemental/composition/tests/assets/simple_sublayer/usda/entry.usd
"""
    metersPerUnit = 0.1
    upAxis = "Y"
)

def Xform "Root"
{
}

Notice that /Root/FirstChild has gone missing.

So I’m a little confused:

  1. I was under the impression that the new order of composition was LIVrRPS where the lowercase r is relocates. Does that not imply that relocates should be weaker than LIV? So my Local FirstChild should win out
  2. Even if my assumption above is incorrect, I completely lose the contents of FirstChild

This seems like I’m hitting a bug somewhere in the composition engine. I haven’t tried this in 24.11 (so maybe I should try again later today) but I couldn’t find documentation on how this is intended to work.

Oh Boy! I expect much learnings and discussions to come on this topic. You’ll find the beginnings of documentation of this behavior in the 24.11 Namespace Editing User Guide, but we are also working on much more comprehensive documentation on relocates. I’ll attempt to summarize what’s going on, here (it is not a bug, though you could argue it warrants some kind of advisory, which might be tricky to provide…)

  • Relocates only affect prims defined across a composition arc, and /Root/FirstChild is defined locally, therefore not a candidate
  • But because there is an authored relocate, the “src” path becomes illegal/unavailable in the composed scene. This is the bit that 24.11 attempts to describe (though the doc has not been pushed yet).
  • Therefore, in the composed scene, there can no longer be a /Root/FirstChild prim

Internally, we call these sites “relocates tombstones” because you can no longer have a “live” prim at the location. But we’re not documenting that…

2 Likes

Oh that’s very interesting. Thanks, Spiff. I’m trying to think of as many edge cases as I can while working on the composition doc/implementation so all of these little gotchas are helpful.