This may be a trivial question but I couldn’t find a solution in the archives. I have a bunch of .abc and .usd files, that contain both geometry and shaders right in the stage root (they are not the child of a singular root prim).
I’d like to include the contents of these files into compositions as references/payloads, but referencing only loads the first prim and the rest of the nodes gets ignored. The only way I was able to add all of them to a stage, was adding as a sublayer, but then the contents still accumulate in the stage root.
I’d like to avoid editing the original files themselves and manually defining a root prim, for pipeline reasons, so I’d like to do one of the followings:
Reference all prims under a single prim. Is there a referencing I trick I couldn’t find?
After loading the prims to the stage using a sublayer, re-parenting the prims to a new root prim, that can be properly referenced to another stage.
Hi Szabolcs,
When referencing, you can choose which prim you are referencing. The simplest thing you could do is to have two references to the same file: one that targets the geometry and the other that targets the shader.
root prim
geometry ----ref----> asset.abc
shader ----ref----> asset.abc
edit: This is a bad idea. The material binding would break.
If you search long/hard enough, you’ll find posts on the old forum trying to explain why we can’t allow you to reference in “all the root prims” into another scene, like you can with Maya referencing. The Maya USD exporter actually gives you an option of inserting a new root prim onto the created Stage, and grouping all of the “root level in the Maya outliner” prims underneath it, to conform with USD’s needs.
It’s been suggested to give that capability to the usdAbc plugin also, though it’s a little trickier there because it would cause issues for round-tripping, and it would need to be verified to work with the logic that translates Alembic instancing into USD instancing. But if it were important enough for someone to make a PR for it, we’d consider it!
The one issue with what @flord suggested is that, if, in asset.abc, the geometry is bound to the shaders/materials, the material bindings will break in the referencing scene. If instead you add the material bindings in the layer Francois is describing, then no problem. But the issue of “relationship mapping” across references is one of the key reasons we strongly advocate for all assets to be organized under a single root prim.