HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdSchemaRegistry Class Reference

#include <schemaRegistry.h>

+ Inheritance diagram for UsdSchemaRegistry:

Public Member Functions

USD_API bool IsConcrete (const TfType &primType) const
 
USD_API bool IsConcrete (const TfToken &primType) const
 
USD_API bool IsAppliedAPISchema (const TfType &apiSchemaType) const
 Returns true if apiSchemaType is an applied API schema type. More...
 
USD_API bool IsAppliedAPISchema (const TfToken &apiSchemaType) const
 Returns true if apiSchemaType is an applied API schema type. More...
 
USD_API bool IsMultipleApplyAPISchema (const TfType &apiSchemaType) const
 Returns true if apiSchemaType is a multiple-apply API schema type. More...
 
USD_API bool IsMultipleApplyAPISchema (const TfToken &apiSchemaType) const
 Returns true if apiSchemaType is a multiple-apply API schema type. More...
 
const UsdPrimDefinitionFindConcretePrimDefinition (const TfToken &typeName) const
 
const UsdPrimDefinitionFindAppliedAPIPrimDefinition (const TfToken &typeName) const
 
const UsdPrimDefinitionGetEmptyPrimDefinition () const
 Returns the empty prim definition. More...
 
USD_API std::unique_ptr
< UsdPrimDefinition
BuildComposedPrimDefinition (const TfToken &primType, const TfTokenVector &appliedAPISchemas) const
 
const VtDictionaryGetFallbackPrimTypes () const
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase ()
 
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void constGetUniqueIdentifier () const
 

Static Public Member Functions

static USD_API UsdSchemaRegistryGetInstance ()
 
static USD_API TfToken GetSchemaTypeName (const TfType &schemaType)
 
template<class SchemaType >
static TfToken GetSchemaTypeName ()
 
static USD_API TfToken GetConcreteSchemaTypeName (const TfType &schemaType)
 
static USD_API TfToken GetAPISchemaTypeName (const TfType &schemaType)
 
static USD_API TfType GetTypeFromSchemaTypeName (const TfToken &typeName)
 
static USD_API TfType GetConcreteTypeFromSchemaTypeName (const TfToken &typeName)
 
static USD_API TfType GetAPITypeFromSchemaTypeName (const TfToken &typeName)
 
static USD_API bool IsDisallowedField (const TfToken &fieldName)
 
static USD_API bool IsTyped (const TfType &primType)
 Returns true if the prim type primType inherits from UsdTyped. More...
 
static USD_API TfType GetTypeFromName (const TfToken &typeName)
 

Friends

class TfSingleton< UsdSchemaRegistry >
 
class UsdPrimDefinition
 

Additional Inherited Members

- Protected Member Functions inherited from TfWeakBase
 ~TfWeakBase ()
 
TfRefPtr< Tf_Remnant_Register () const
 
template<class T >
TfRefPtr< Tf_Remnant_Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

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.

The data contained herein comes from the generatedSchema.usda file (generated when a schema.usda file is processed by usdGenSchema) of each schema-defining module. The registry expects each schema type to be represented as a single prim spec with its inheritance flattened, i.e. the prim spec contains a union of all its local and class inherited property specs and metadata fields.

It is used by the Usd core, via UsdPrimDefinition, to determine how to create scene description for unauthored "built-in" properties of schema classes, to enumerate all properties for a given schema class, and finally to provide fallback values for unauthored built-in properties.

Definition at line 63 of file schemaRegistry.h.

Member Function Documentation

USD_API std::unique_ptr<UsdPrimDefinition> UsdSchemaRegistry::BuildComposedPrimDefinition ( const TfToken primType,
const TfTokenVector appliedAPISchemas 
) const

Composes and returns a new UsdPrimDefinition from the given primType and list of applieSchemas. This prim definition will contain a union of properties from the registered prim definitions of each of the provided types.

const UsdPrimDefinition* UsdSchemaRegistry::FindAppliedAPIPrimDefinition ( const TfToken typeName) const
inline

Finds the prim definition for the given typeName token if typeName is a registered applied API schema type. Returns null if it is not.

Definition at line 185 of file schemaRegistry.h.

const UsdPrimDefinition* UsdSchemaRegistry::FindConcretePrimDefinition ( const TfToken typeName) const
inline

Finds the prim definition for the given typeName token if typeName is a registered concrete typed schema type. Returns null if it is not.

Definition at line 176 of file schemaRegistry.h.

static USD_API TfToken UsdSchemaRegistry::GetAPISchemaTypeName ( const TfType schemaType)
static

Return the type name in the USD schema for API schema types only from the given registered schemaType.

static USD_API TfType UsdSchemaRegistry::GetAPITypeFromSchemaTypeName ( const TfToken typeName)
static

Return the TfType of the schema corresponding to the given API schema type name typeName. This the inverse of GetAPISchemaTypeNAme.

static USD_API TfToken UsdSchemaRegistry::GetConcreteSchemaTypeName ( const TfType schemaType)
static

Return the type name in the USD schema for concrete prim types only from the given registered schemaType.

static USD_API TfType UsdSchemaRegistry::GetConcreteTypeFromSchemaTypeName ( const TfToken typeName)
static

Return the TfType of the schema corresponding to the given concrete prim type name typeName. This the inverse of GetConcreteSchemaTypeName.

const UsdPrimDefinition* UsdSchemaRegistry::GetEmptyPrimDefinition ( ) const
inline

Returns the empty prim definition.

Definition at line 192 of file schemaRegistry.h.

const VtDictionary& UsdSchemaRegistry::GetFallbackPrimTypes ( ) const
inline

Returns a dictionary mapping concrete schema prim type names to a VtTokenArray of fallback prim type names if fallback types are defined for the schema type in its registered schema.

The standard use case for this to provide schema defined metadata that can be saved with a stage to inform an older version of USD - that may not have some schema types - as to which types it can used instead when encountering a prim of one these types.

See Also
UsdStage::WriteFallbackPrimTypes
Usd_OM_FallbackPrimTypes

Definition at line 216 of file schemaRegistry.h.

static USD_API UsdSchemaRegistry& UsdSchemaRegistry::GetInstance ( )
inlinestatic

Definition at line 66 of file schemaRegistry.h.

static USD_API TfToken UsdSchemaRegistry::GetSchemaTypeName ( const TfType schemaType)
static

Return the type name in the USD schema for prims or API schemas of the given registered schemaType.

template<class SchemaType >
static TfToken UsdSchemaRegistry::GetSchemaTypeName ( )
inlinestatic

Return the type name in the USD schema for prims or API schemas of the given registered SchemaType.

Definition at line 79 of file schemaRegistry.h.

static USD_API TfType UsdSchemaRegistry::GetTypeFromName ( const TfToken typeName)
static

Finds the TfType of a schema with typeName

This is primarily for when you have been provided Schema typeName (perhaps from a User Interface or Script) and need to identify if a prim's type inherits/is that typeName. If the type name IS known, then using the schema class is preferred.

1 # This code attempts to match all prims on a stage to a given
2 # user specified type, making the traditional schema based idioms not
3 # applicable.
4 data = parser.parse_args()
5 tfType = UsdSchemaRegistry.GetTypeFromName(data.type)
6 matchedPrims = [p for p in stage.Traverse() if p.IsA(tfType)]
Note
It's worth noting that GetTypeFromName("Sphere") == GetTypeFromName("UsdGeomSphere"), as this function resolves both the Schema's C++ class name and any registered aliases from a libraries plugInfo.json file. However, GetTypeFromName("Boundable") != GetTypeFromName("UsdGeomBoundable") because type aliases don't get registered for abstract schema types.
static USD_API TfType UsdSchemaRegistry::GetTypeFromSchemaTypeName ( const TfToken typeName)
static

Return the TfType of the schema corresponding to the given prim or API schema name typeName. This the inverse of GetSchemaTypeName.

USD_API bool UsdSchemaRegistry::IsAppliedAPISchema ( const TfType apiSchemaType) const

Returns true if apiSchemaType is an applied API schema type.

USD_API bool UsdSchemaRegistry::IsAppliedAPISchema ( const TfToken apiSchemaType) const

Returns true if apiSchemaType is an applied API schema type.

USD_API bool UsdSchemaRegistry::IsConcrete ( const TfType primType) const

Returns true if the prim type primType is instantiable in scene description.

USD_API bool UsdSchemaRegistry::IsConcrete ( const TfToken primType) const

Returns true if the prim type primType is instantiable in scene description.

static USD_API bool UsdSchemaRegistry::IsDisallowedField ( const TfToken fieldName)
static

Returns true if the field fieldName cannot have fallback values specified in schemas.

Fields are generally disallowed because their fallback values aren't used. For instance, fallback values for composition arcs aren't used during composition, so allowing them to be set in schemas would be misleading.

USD_API bool UsdSchemaRegistry::IsMultipleApplyAPISchema ( const TfType apiSchemaType) const

Returns true if apiSchemaType is a multiple-apply API schema type.

USD_API bool UsdSchemaRegistry::IsMultipleApplyAPISchema ( const TfToken apiSchemaType) const

Returns true if apiSchemaType is a multiple-apply API schema type.

static USD_API bool UsdSchemaRegistry::IsTyped ( const TfType primType)
static

Returns true if the prim type primType inherits from UsdTyped.

Friends And Related Function Documentation

Definition at line 221 of file schemaRegistry.h.

friend class UsdPrimDefinition
friend

Definition at line 243 of file schemaRegistry.h.


The documentation for this class was generated from the following file: