Creating variations of a Schema Type

I’m defining a custom schema and I want to have two versions of a prim, one that’s spatial (Xform) and another that’s not

I was hoping to define one “ApplePie” and then make the spatial one inherit from both it and Xform. “AppleSpatialPie”

But usdGenSchema says Schemas can only inherit from one other schema at most. This schema inherits from 2

Any ideas on how to achieve something like this?
Of course, I could always duplicate everything, but it would be nice to make use of inheritance here.

Actually it turns out there’s an example in the docs further down which does the trick

# Example of a concrete, typed (IsA) schema with built-in applied API schemas
class MyCustomPrim "MyCustomPrim" (
    inherits = </Typed>
 
    # These listed applied API schemas will be built-in to this schema type.
    prepend apiSchemas = ["ExampleSingleApplyAPI", "ExampleMultiApplyAPI:foo"]
)  {
    # Example of a fallback value override for a theoretical property defined in 
    # the API schema instance "ExampleMultiApplyAPI:foo"
    bool exampleMulti:foo:boolAttr = true (
        customData = {
            bool apiSchemaOverride = true
        }
    }
}
1 Like

Right on, @dhruvgovil. The concrete UsdLux light types use this pattern, and we might be leveraging it pretty significantly in the not-too-distant future to support other new features with existing schemas.