Singleton registry that provides access to schema type information and the prim definitions for registered Usd "IsA" and applied API schema types. More...
Public Member Functions | |
USD_API TfToken | GetPropertyNamespacePrefix (const TfToken &multiApplyAPISchemaName) const |
Returns the namespace prefix that is prepended to all properties of the given multiApplyAPISchemaName . More... | |
const UsdPrimDefinition * | FindConcretePrimDefinition (const TfToken &typeName) const |
Finds the prim definition for the given typeName token if typeName is a registered concrete typed schema type. More... | |
const UsdPrimDefinition * | FindAppliedAPIPrimDefinition (const TfToken &typeName) const |
Finds the prim definition for the given typeName token if typeName is a registered applied API schema type. More... | |
const UsdPrimDefinition * | GetEmptyPrimDefinition () const |
Returns the empty prim definition. More... | |
USD_API std::unique_ptr < UsdPrimDefinition > | BuildComposedPrimDefinition (const TfToken &primType, const TfTokenVector &appliedAPISchemas) const |
Composes and returns a new UsdPrimDefinition from the given primType and list of appliedSchemas . More... | |
const VtDictionary & | GetFallbackPrimTypes () const |
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. More... | |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Static Public Member Functions | |
static USD_API UsdSchemaRegistry & | GetInstance () |
static USD_API TfToken | GetSchemaTypeName (const TfType &schemaType) |
Return the type name in the USD schema for prims or API schemas of the given registered schemaType . More... | |
template<class SchemaType > | |
static TfToken | GetSchemaTypeName () |
Return the type name in the USD schema for prims or API schemas of the given registered SchemaType . More... | |
static USD_API TfToken | GetConcreteSchemaTypeName (const TfType &schemaType) |
Return the type name in the USD schema for concrete prim types only from the given registered schemaType . More... | |
static USD_API TfToken | GetAPISchemaTypeName (const TfType &schemaType) |
Return the type name in the USD schema for API schema types only from the given registered schemaType . More... | |
static USD_API TfType | GetTypeFromSchemaTypeName (const TfToken &typeName) |
Return the TfType of the schema corresponding to the given prim or API schema name typeName . More... | |
static USD_API TfType | GetConcreteTypeFromSchemaTypeName (const TfToken &typeName) |
Return the TfType of the schema corresponding to the given concrete prim type name typeName . More... | |
static USD_API TfType | GetAPITypeFromSchemaTypeName (const TfToken &typeName) |
Return the TfType of the schema corresponding to the given API schema type name typeName . More... | |
static USD_API bool | IsDisallowedField (const TfToken &fieldName) |
Returns true if the field fieldName cannot have fallback values specified in schemas. More... | |
static USD_API bool | IsTyped (const TfType &primType) |
Returns true if the prim type primType inherits from UsdTyped. More... | |
static USD_API UsdSchemaKind | GetSchemaKind (const TfType &schemaType) |
Returns the kind of the schema the given schemaType represents. More... | |
static USD_API UsdSchemaKind | GetSchemaKind (const TfToken &typeName) |
Returns the kind of the schema the given typeName represents. More... | |
static USD_API bool | IsConcrete (const TfType &primType) |
Returns true if the prim type primType is instantiable in scene description. More... | |
static USD_API bool | IsConcrete (const TfToken &primType) |
Returns true if the prim type primType is instantiable in scene description. More... | |
static USD_API bool | IsAppliedAPISchema (const TfType &apiSchemaType) |
Returns true if apiSchemaType is an applied API schema type. More... | |
static USD_API bool | IsAppliedAPISchema (const TfToken &apiSchemaType) |
Returns true if apiSchemaType is an applied API schema type. More... | |
static USD_API bool | IsMultipleApplyAPISchema (const TfType &apiSchemaType) |
Returns true if apiSchemaType is a multiple-apply API schema type. More... | |
static USD_API bool | IsMultipleApplyAPISchema (const TfToken &apiSchemaType) |
Returns true if apiSchemaType is a multiple-apply API schema type. More... | |
static USD_API TfType | GetTypeFromName (const TfToken &typeName) |
Finds the TfType of a schema with typeName . More... | |
static USD_API std::pair < TfToken, TfToken > | GetTypeNameAndInstance (const TfToken &apiSchemaName) |
Returns the schema type name and the instance name parsed from the given apiSchemaName . More... | |
static USD_API bool | IsAllowedAPISchemaInstanceName (const TfToken &apiSchemaName, const TfToken &instanceName) |
Returns true if the given instanceName is an allowed instance name for the multiple apply API schema named apiSchemaName . More... | |
static USD_API const TfTokenVector & | GetAPISchemaCanOnlyApplyToTypeNames (const TfToken &apiSchemaName, const TfToken &instanceName=TfToken()) |
Returns a list of prim type names that the given apiSchemaName can only be applied to. More... | |
static USD_API const std::map < TfToken, TfTokenVector > & | GetAutoApplyAPISchemas () |
Returns a map of the names of all registered auto apply API schemas to the list of type names each is registered to be auto applied to. More... | |
static USD_API void | CollectAddtionalAutoApplyAPISchemasFromPlugins (std::map< TfToken, TfTokenVector > *autoApplyAPISchemas) |
Collects all the additional auto apply schemas that can be defined in a plugin through "AutoApplyAPISchemas" metadata and adds the mappings to autoApplyAPISchemas . More... | |
Friends | |
class | TfSingleton< UsdSchemaRegistry > |
class | UsdPrimDefinition |
Additional Inherited Members | |
Protected Member Functions inherited from TfWeakBase | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
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 64 of file schemaRegistry.h.
USD_API std::unique_ptr<UsdPrimDefinition> BuildComposedPrimDefinition | ( | const TfToken & | primType, |
const TfTokenVector & | appliedAPISchemas | ||
) | const |
Composes and returns a new UsdPrimDefinition from the given primType
and list of appliedSchemas
.
This prim definition will contain a union of properties from the registered prim definitions of each of the provided types.
|
static |
Collects all the additional auto apply schemas that can be defined in a plugin through "AutoApplyAPISchemas" metadata and adds the mappings to autoApplyAPISchemas
.
These are separate from the auto-apply schemas that are built in to the applied API schema types themselves and can be defined in any plugin to map any applied API schema to any concrete prim type.
Note that GetAutoApplyAPISchemas will already include API schemas collected from this method; this function is provided for clients that may want to collect just these plugin API schema mappings.
|
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 289 of file schemaRegistry.h.
|
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 280 of file schemaRegistry.h.
|
static |
Returns a list of prim type names that the given apiSchemaName
can only be applied to.
A non-empty list indicates that the API schema can only be applied to prim that are or derive from prim type names in the list. If the list is empty, the API schema can be applied to prims of any type.
If a non-empty instanceName
is provided, this will first look for a list of "can only apply to" names specific to that instance of the API schema and return that if found. If a list is not found for the specific instance, it will fall back to looking for a "can only apply to" list for just the schema name itself.
Return the type name in the USD schema for API schema types only from the given registered schemaType
.
Return the TfType of the schema corresponding to the given API schema type name typeName
.
This the inverse of GetAPISchemaTypeNAme.
|
static |
Returns a map of the names of all registered auto apply API schemas to the list of type names each is registered to be auto applied to.
The list of type names to apply to will directly match what is specified in the plugin metadata for each schema type. While auto apply schemas do account for the existence and validity of the type names and expand to include derived types of the listed types, the type lists returned by this function do not.
Return the type name in the USD schema for concrete prim types only from the given registered schemaType
.
Return the TfType of the schema corresponding to the given concrete prim type name typeName
.
This the inverse of GetConcreteSchemaTypeName.
|
inline |
Returns the empty prim definition.
Definition at line 296 of file schemaRegistry.h.
|
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.
Definition at line 320 of file schemaRegistry.h.
Returns the namespace prefix that is prepended to all properties of the given multiApplyAPISchemaName
.
|
static |
Returns the kind of the schema the given schemaType
represents.
This returns UsdSchemaKind::Invalid if schemaType
is not a valid schema type or if the kind cannot be determined from type's plugin information.
|
static |
Returns the kind of the schema the given typeName
represents.
This returns UsdSchemaKind::Invalid if typeName
is not a valid schema type name or if the kind cannot be determined from type's plugin information.
Return the type name in the USD schema for prims or API schemas of the given registered schemaType
.
|
inlinestatic |
Return the type name in the USD schema for prims or API schemas of the given registered SchemaType
.
Definition at line 80 of file schemaRegistry.h.
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.
Return the TfType of the schema corresponding to the given prim or API schema name typeName
.
This the inverse of GetSchemaTypeName.
|
static |
Returns the schema type name and the instance name parsed from the given apiSchemaName
.
apiSchemaName
is the name of an applied schema as it appears in the list of applied schemas on a prim. For single-apply API schemas the name will just be the schema type name. For multiple-apply schemas the name should include the schema type name and the applied instance name separated by a namespace delimiter, for example 'CollectionAPI:plasticStuff'.
This function returns the separated schema type name and instance name component tokens if possible, otherwise it returns the apiSchemaName
as the type name and an empty instance name.
Note that no validation is done on the returned tokens. Clients are advised to use GetTypeFromSchemaTypeName() to validate the typeName token.
|
static |
Returns true if the given instanceName
is an allowed instance name for the multiple apply API schema named apiSchemaName
.
Any instance name that matches the name of a property provided by the API schema is disallowed and will return false. If the schema type has plugin metadata that specifies allowed instance names, then only those specified names are allowed for the schema type. If the instance name is empty or the API is not a multiple apply schema, this will return false.
|
static |
Returns true if apiSchemaType
is an applied API schema type.
|
static |
Returns true if apiSchemaType
is an applied API schema type.
|
static |
Returns true if the prim type primType
is instantiable in scene description.
|
static |
Returns true if the prim type primType
is instantiable in scene description.
|
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.
|
static |
Returns true if apiSchemaType
is a multiple-apply API schema type.
|
static |
Returns true if apiSchemaType
is a multiple-apply API schema type.
|
static |
Returns true if the prim type primType
inherits from UsdTyped.