Why SdfSchemaBase and SdfSchema?

Why are SdfSchemaBase and SdfSchema different classes? Is this just a historical artifact, or is there a reason they can’t be merged/treated as the same?

  • Are there other classes in OpenUSD that derive from SdfSchemaBase?
  • Are users expected to sometimes write custom classes that derive from SdfSchemaBase, e.g. while writing an SdfFileFormat plugin?
  • Could there be multiple distinct SdfSchemaBase instances during program execution which aren’t the immortal SdfSchema instance?

There are not. It is required for Pixar because Presto builds atop OpenUSD with its own “Sd” document model, in which all Presto/Sd layers are SdfLayers, but which have a SdSchema that is distinct from SdfSchema.

We don’t expect anyone to have a need to do that, and it would create interoperability issues that we deal with in Presto only because we need to. In a future world we hope to eliminate our own need, but it’s going to be awhile.

That is the case in Presto. You will also soon be seeing some of the “usdMode” checks in Pcp being replaced by checks of a layer’s schema being the SdfSchema or not, as we begin the work that will ultimately allow us to eliminate multiple Schemas.