UsdSchemaRegistry#
Fully qualified name: usdrt::UsdSchemaRegistry
-
class UsdSchemaRegistry#
Singleton registry that provides access to schema type information and the prim definitions for registered Usd “IsA” and applied API schema types. It also contains the data from the generated schemas that is used by prim definitions to provide properties and fallbacks.
Public Functions
-
inline bool IsTyped(const TfToken &primType)#
Check if the given schema name inherits from UsdTyped.
Note
This differs from USD. In USD, the expected type for
primType
is TfType. Here, we use TfToken instead as USDRT does not implement its own TfType.Note
This differs from USD. This function cannot be static with the USDRT
isA
implementation.
-
inline bool IsConcrete(const TfToken &primType) const#
Check if the given schema name is a concrete schema.
- Parameters:
primType – TfToken for the schema type name.
- Returns:
Returns true if the prim type
primType
is instantiable in scene description.
-
inline bool IsAppliedAPISchema(const TfToken &apiSchemaType) const#
Check if the given schema type is an applied api schema type.
- Parameters:
apiSchemaType – TfToken for the schema type name.
- Returns:
Returns true if
apiSchemaType
is an applied API schema type.
- inline bool IsMultipleApplyAPISchema(
- const TfToken &apiSchemaType,
Check if the given schema type is a multiple-apply API schema type.
- Parameters:
apiSchemaType – TfToken for the schema type name.
- Returns:
Returns true if
apiSchemaType
is a multiple-apply API schema type.
-
inline bool IsUnknown(const TfToken &schemaType) const#
Check if
schemaType
is a known schema within the registry.Note
this is an additional API function in place of querying the TfType system.
- Parameters:
schemaType – TfToken name for the schema to validate.
- Returns:
Returns true is
schemaType
is an unknown schema.
- inline bool IsA( ) const#
Check if the given
sourceTypeName
type is or inherits fromqueryTypeName
.Schema full name or alias can be given.
Usage example to check if UsdGeomCube is an instance of UsdTyped.
UsdSchemaRegistry::GetInstance().IsA("UsdGeomCube", "UsdTyped")()
Note
This is an additional API function to take the place of having to query the TfType system.
- Parameters:
sourceTypeName – The base schema type name for this query.
queryTypeName – The schema type name we are asking about.
- Returns:
Returns true if the sourceTypeName is an instance of the queryTypeName.
-
inline TfToken GetAliasFromName(const TfToken &name) const#
Get the schema type name alias from the given name by querying the underlying Usd TfType system.
This is used when applying or querying schema names as Fabric applies schemas with alias only. USDRT supports querying and applying using either name.
If
name
is already the alias, this function will still query the TfType system and return the alias.Note
This is an additional API not present in USD to take place of implementing a TfType system. Since this queries the underlying Usd TfType system, we assume that the USDRT schema is also a registered USD schema.
- Parameters:
name – the full schema type name or alias.
- Returns:
the TfToken for the schema alias.
-
template<typename SchemaType, typename QuerySchemaType>
inline bool IsA( Check if the given
SchemaType
type is or inherits fromQuerySchemaType
.Schema full name or alias can be given.
Usage example to check if UsdGeomCube is an instance of UsdTyped.
UsdSchemaRegistry::GetInstance().IsA<UsdGeomCube, UsdTyped>()
Note
This is an additional API function to take the place of having to query the TfType system.
- Template Parameters:
SchemaType – Base schema type for this query.
QuerySchemaType – Schema type we are asking about.
- Returns:
Returns true if the
SchemaType
is an instance of theQuerySchemaType
.
-
template<typename SchemaType>
inline bool IsA( - TfToken sourceTypeName,
Check if the given
sourceTypeName
is or inherits fromSchemaType
.Schema full name or alias can be given.
Usage example to check if UsdGeomCube is an instance of UsdTyped.
UsdSchemaRegistry::GetInstance().IsA<UsdTyped>("Cube"))
Note
This is an additional API function to take the place of having to query the TfType system.
- Parameters:
sourceTypeName – Base schema type for this query.
- Template Parameters:
SchemaType – Schema type we are asking about.
- Returns:
Returns true if the
sourceTypeName
is an instance of theSchemaType
.
-
inline explicit operator bool() const#
Boolean operator.
- Returns:
Return true if the schema registry is initialized.
Public Static Functions
-
static inline UsdSchemaRegistry GetInstance()#
Get the schema registry instance.
-
template<class SchemaType>
static inline TfToken GetSchemaTypeName()# Get the schema type name for given
schemaType
.Note
This differs from USD. In USD, the expected return type is TfType. Here, we use TfToken instead as USDRT does not implement its own TfType.
- Returns:
Returns a TfToken for the type name of the USD schema.
-
inline bool IsTyped(const TfToken &primType)#