UsdSchemaBase, UsdAPISchemaBase
The UsdSchemaBase and UsdAPISchemaBase are both integral parts of the USD (Universal Scene Description) framework, which is a system for describing 3D scenes and animations in a platform-independent format.
UsdSchemaBase
UsdSchemaBase is the base class for all concrete, instantiable USD schema classes. It provides a common API for discovery and navigation of schema types.
Key Features of UsdSchemaBase
- Type identification: UsdSchemaBase provides the
GetSchemaTypemethod, which allows for the identification of the specific schema type.
- Type introspection: It also offers type introspection via the
HasAPIandGetAppliedAPISchemasmethods. These enable checks for the presence of API schemas and the retrieval of a list of all applied API schemas, respectively.
- Type casting: The
Castmethod provided by UsdSchemaBase allows for safe down-casting to more specific schema types.
UsdAPISchemaBase
On the other hand, UsdAPISchemaBase serves as the base class for all API schema classes, that is, non-concrete schema classes that provide an interface to specific features or behaviors of an object.
API schemas can be categorized into two types:
- Single-apply API schemas: These can be applied only once to a given object. They are used to add optional functionality to an object, without modifying the object’s existing capabilities.
- Multiple-apply API schemas: These can be applied multiple times to an object, with different schema instance names. This allows for the creation of collections of similar features or behaviors.
Key Features of UsdAPISchemaBase
- API application and removal: UsdAPISchemaBase provides the
ApplyandRemovemethods for application and removal of API schemas.
- API existence check: The
IsAppliedmethod allows for checking whether a particular API schema has been applied to an object.
- API introspection: The
GetSchemaTypemethod enables the identification of the specific API schema type.
In conclusion, UsdSchemaBase and UsdAPISchemaBase form the cornerstone of the USD framework, providing the necessary tools for type identification, introspection, casting, application and removal of schemas. They form the foundation upon which the rest of the USD API is built, enabling the creation, manipulation, and querying of 3D scene data in a platform-independent manner.