Referencing Alembic Files In USD And Building A Stage From There

I want to create a new stage, load an alembic file into it, then add to the scene some lights. The problem I have is that I cannot add any new prims to the scene if I just load it via UsdStage::Open as I get the error “Alembic file CreateSpec() not supported” when I try to add a light prim.

So I thought I could create a blank stage in memory, add the alembic file as a reference, and then add the lights to it, but that only brings in part of the original alembic file (compared to if I load the alembic file directly into the scene - see below) and I don’t understand why.

The generated udsa file I get when just loading the alembic file via UsdStage::Open has a few root entries as follows, with a top level defaultPrim = “Persp” entry:

#usda 1.0
(
    defaultPrim = "Persp"
   ....
)
def Camera "Persp"
{
   ....
}
def Mesh "base"
{
  .....
}
def Mesh "main"
{
   .....
}

But when I add the file as a reference, only the def Camera “Persp” is bought in, but the rest (the actual model data) is not!

Any pointers over what i’m doing wrong (or how i’m going about it) would be greatly appreciated. I think i’m missing some basic knowledge on what to expect here.

Basically I want to bring an alembic file into a stage, then add some lights to it, so that I can see the model lit when viewed with a hydra delegate. I’m working in C++ if that makes any difference.

Cheers,
Simon.

You might want to look at USD Frequently Asked Questions — Universal Scene Description 23.11 documentation or USD Basics for more information about the differences between “referencing” and “sublayering”. Bur the TL;DR answer is you should create a new USD stage, sublayer the alembic file onto the root layer (instead of referencing it). Then you can author any edits to the USD stage’s root layer, and they will override any data coming in from the Alembic file.

Mark

1 Like

That is exactly the information I was looking for, thanks Mark!

There is so much to take on board going from zero understanding to fully integrating a USD Hydra interface in an application it’s crazy. Thanks for the link to the FAQ - I evidently need to study that some more!