Loading...
Searching...
No Matches
UsdSchemaRegistry Class Reference

Singleton registry that provides access to schema type information and the prim definitions for registered Usd "IsA" and applied API schema types. More...

#include <schemaRegistry.h>

+ Inheritance diagram for UsdSchemaRegistry:

Classes

struct  SchemaInfo
 Structure that holds the information about a schema that is registered with the schema registry. More...
 

Public Types

enum class  VersionPolicy {
  All , GreaterThan , GreaterThanOrEqual , LessThan ,
  LessThanOrEqual
}
 A policy for filtering by schema version when querying for schemas in a particular schema family. More...
 
using TokenToTokenVectorMap = std::unordered_map< TfToken, TfTokenVector, TfHash >
 

Public Member Functions

const UsdPrimDefinitionFindConcretePrimDefinition (const TfToken &typeName) const
 Finds the prim definition for the given typeName token if typeName is a registered concrete typed schema type.
 
const UsdPrimDefinitionFindAppliedAPIPrimDefinition (const TfToken &typeName) const
 Finds the prim definition for the given typeName token if typeName is a registered applied API schema type.
 
const UsdPrimDefinitionGetEmptyPrimDefinition () const
 Returns the empty prim definition.
 
USD_API std::unique_ptr< UsdPrimDefinitionBuildComposedPrimDefinition (const TfToken &primType, const TfTokenVector &appliedAPISchemas) const
 Composes and returns a new UsdPrimDefinition from the given primType and list of appliedSchemas.
 
const VtDictionaryGetFallbackPrimTypes () 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.
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Static Public Member Functions

static USD_API UsdSchemaRegistryGetInstance ()
 
static USD_API TfToken MakeSchemaIdentifierForFamilyAndVersion (const TfToken &schemaFamily, UsdSchemaVersion schemaVersion)
 Creates the schema identifier that would be used to define a schema of the given schemaFamily with the given schemaVersion.
 
static USD_API std::pair< TfToken, UsdSchemaVersion > ParseSchemaFamilyAndVersionFromIdentifier (const TfToken &schemaIdentifier)
 Parses and returns the schema family and version values from the given schemaIdentifier.
 
static USD_API bool IsAllowedSchemaFamily (const TfToken &schemaFamily)
 Returns whether the given schemaFamily is an allowed schema family name.
 
static USD_API bool IsAllowedSchemaIdentifier (const TfToken &schemaIdentifier)
 Returns whether the given schemaIdentifier is an allowed schema identifier.
 
static USD_API const SchemaInfoFindSchemaInfo (const TfType &schemaType)
 Finds and returns the schema info for a registered schema with the given schemaType.
 
template<class SchemaType >
static const SchemaInfoFindSchemaInfo ()
 Finds and returns the schema info for a registered schema with the C++ schema class SchemaType.
 
static USD_API const SchemaInfoFindSchemaInfo (const TfToken &schemaIdentifier)
 Finds and returns the schema info for a registered schema with the given schemaIdentifier.
 
static USD_API const SchemaInfoFindSchemaInfo (const TfToken &schemaFamily, UsdSchemaVersion schemaVersion)
 Finds and returns the schema info for a registered schema in the given schemaFamily with the given schemaVersion.
 
static USD_API const std::vector< const SchemaInfo * > & FindSchemaInfosInFamily (const TfToken &schemaFamily)
 Finds all schemas in the given schemaFamily and returns their their schema info ordered from highest version to lowest version.
 
static USD_API std::vector< const SchemaInfo * > FindSchemaInfosInFamily (const TfToken &schemaFamily, UsdSchemaVersion schemaVersion, VersionPolicy versionPolicy)
 Finds all schemas in the given schemaFamily, filtered according to the given schemaVersion and versionPolicy, and returns their their schema info ordered from highest version to lowest version.
 
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.
 
template<class SchemaType >
static TfToken GetSchemaTypeName ()
 Return the type name in the USD schema for prims or API schemas of the given registered SchemaType.
 
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.
 
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.
 
static USD_API TfType GetTypeFromSchemaTypeName (const TfToken &typeName)
 Return the TfType of the schema corresponding to the given prim or API schema name typeName.
 
static USD_API TfType GetConcreteTypeFromSchemaTypeName (const TfToken &typeName)
 Return the TfType of the schema corresponding to the given concrete prim type name typeName.
 
static USD_API TfType GetAPITypeFromSchemaTypeName (const TfToken &typeName)
 Return the TfType of the schema corresponding to the given API schema type name typeName.
 
static USD_API bool IsDisallowedField (const TfToken &fieldName)
 Returns true if the field fieldName cannot have fallback values specified in schemas.
 
static USD_API bool IsTyped (const TfType &primType)
 Returns true if the prim type primType inherits from UsdTyped.
 
static USD_API UsdSchemaKind GetSchemaKind (const TfType &schemaType)
 Returns the kind of the schema the given schemaType represents.
 
static USD_API UsdSchemaKind GetSchemaKind (const TfToken &typeName)
 Returns the kind of the schema the given typeName represents.
 
static USD_API bool IsConcrete (const TfType &primType)
 Returns true if the prim type primType is instantiable in scene description.
 
static USD_API bool IsConcrete (const TfToken &primType)
 Returns true if the prim type primType is instantiable in scene description.
 
static USD_API bool IsAbstract (const TfType &primType)
 Returns true if the prim type primType is an abstract schema type and, unlike a concrete type, is not instantiable in scene description.
 
static USD_API bool IsAbstract (const TfToken &primType)
 Returns true if the prim type primType is an abstract schema type and, unlike a concrete type, is not instantiable in scene description.
 
static USD_API bool IsAppliedAPISchema (const TfType &apiSchemaType)
 Returns true if apiSchemaType is an applied API schema type.
 
static USD_API bool IsAppliedAPISchema (const TfToken &apiSchemaType)
 Returns true if apiSchemaType is an applied API schema type.
 
static USD_API bool IsMultipleApplyAPISchema (const TfType &apiSchemaType)
 Returns true if apiSchemaType is a multiple-apply API schema type.
 
static USD_API bool IsMultipleApplyAPISchema (const TfToken &apiSchemaType)
 Returns true if apiSchemaType is a multiple-apply API schema type.
 
static USD_API TfType GetTypeFromName (const TfToken &typeName)
 Finds the TfType of a schema with typeName.
 
static USD_API std::pair< TfToken, TfTokenGetTypeNameAndInstance (const TfToken &apiSchemaName)
 Returns the schema type name and the instance name parsed from the given apiSchemaName.
 
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.
 
static USD_API const TfTokenVectorGetAPISchemaCanOnlyApplyToTypeNames (const TfToken &apiSchemaName, const TfToken &instanceName=TfToken())
 Returns a list of prim type names that the given apiSchemaName can only be applied to.
 
static USD_API const TokenToTokenVectorMap & 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.
 
static USD_API void CollectAddtionalAutoApplyAPISchemasFromPlugins (TokenToTokenVectorMap *autoApplyAPISchemas)
 Collects all the additional auto apply schemas that can be defined in a plugin through "AutoApplyAPISchemas" metadata and adds the mappings to autoApplyAPISchemas.
 
static USD_API TfToken MakeMultipleApplyNameTemplate (const std::string &namespacePrefix, const std::string &baseName)
 Creates a name template that can represent a property or API schema that belongs to a multiple apply schema and will therefore have multiple instances with different names.
 
static USD_API TfToken MakeMultipleApplyNameInstance (const std::string &nameTemplate, const std::string &instanceName)
 Returns an instance of a multiple apply schema name from the given nameTemplate for the given instanceName.
 
static USD_API TfToken GetMultipleApplyNameTemplateBaseName (const std::string &nameTemplate)
 Returns the base name for the multiple apply schema name template nameTemplate.
 
static USD_API bool IsMultipleApplyNameTemplate (const std::string &nameTemplate)
 Returns true if nameTemplate is a multiple apply schema name template.
 

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
 

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 70 of file schemaRegistry.h.


Class Documentation

◆ UsdSchemaRegistry::SchemaInfo

struct UsdSchemaRegistry::SchemaInfo

Structure that holds the information about a schema that is registered with the schema registry.

Definition at line 79 of file schemaRegistry.h.

Class Members
TfToken family The name of the family of schema's which the schema is a version of.

This is the same as the schema identifier with the version suffix removed (or exactly the same as the schema identifier in the case of version 0 of a schema which will not have a version suffix.)

TfToken identifier The schema's identifier which is how the schema type is referred to in scene description and is also the key used to look up the schema's prim definition.
UsdSchemaKind kind The schema's kind: ConcreteTyped, SingleApplyAPI, etc.
TfType type The schema's type as registered with the TfType registry.

This will correspond to the C++ class of the schema if a class was generated for it.

UsdSchemaVersion version The version number of the schema within its schema family.

Member Typedef Documentation

◆ TokenToTokenVectorMap

using TokenToTokenVectorMap = std::unordered_map<TfToken, TfTokenVector, TfHash>

Definition at line 74 of file schemaRegistry.h.

Member Enumeration Documentation

◆ VersionPolicy

enum class VersionPolicy
strong

A policy for filtering by schema version when querying for schemas in a particular schema family.

Definition at line 211 of file schemaRegistry.h.

Member Function Documentation

◆ BuildComposedPrimDefinition()

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.

◆ CollectAddtionalAutoApplyAPISchemasFromPlugins()

static USD_API void CollectAddtionalAutoApplyAPISchemasFromPlugins ( TokenToTokenVectorMap *  autoApplyAPISchemas)
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.

◆ FindAppliedAPIPrimDefinition()

const UsdPrimDefinition * 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 525 of file schemaRegistry.h.

◆ FindConcretePrimDefinition()

const UsdPrimDefinition * 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 515 of file schemaRegistry.h.

◆ FindSchemaInfo() [1/4]

static const SchemaInfo * FindSchemaInfo ( )
inlinestatic

Finds and returns the schema info for a registered schema with the C++ schema class SchemaType.

All generated C++ schema classes, i.e. classes that derive from UsdSchemaBase, are expected to have their types registered with the schema registry and as such, the return value from this function should never be null. A null return value is indication of a coding error even though this function itself will not report an error.

Definition at line 189 of file schemaRegistry.h.

◆ FindSchemaInfo() [2/4]

static USD_API const SchemaInfo * FindSchemaInfo ( const TfToken schemaFamily,
UsdSchemaVersion  schemaVersion 
)
static

Finds and returns the schema info for a registered schema in the given schemaFamily with the given schemaVersion.

Returns null if no registered schema in the schema family with the given version exists.

◆ FindSchemaInfo() [3/4]

static USD_API const SchemaInfo * FindSchemaInfo ( const TfToken schemaIdentifier)
static

Finds and returns the schema info for a registered schema with the given schemaIdentifier.

Returns null if no registered schema with the schema identifier exists.

◆ FindSchemaInfo() [4/4]

static USD_API const SchemaInfo * FindSchemaInfo ( const TfType schemaType)
static

Finds and returns the schema info for a registered schema with the given schemaType.

Returns null if no registered schema with the schema type exists.

◆ FindSchemaInfosInFamily() [1/2]

static USD_API const std::vector< const SchemaInfo * > & FindSchemaInfosInFamily ( const TfToken schemaFamily)
static

Finds all schemas in the given schemaFamily and returns their their schema info ordered from highest version to lowest version.

◆ FindSchemaInfosInFamily() [2/2]

static USD_API std::vector< const SchemaInfo * > FindSchemaInfosInFamily ( const TfToken schemaFamily,
UsdSchemaVersion  schemaVersion,
VersionPolicy  versionPolicy 
)
static

Finds all schemas in the given schemaFamily, filtered according to the given schemaVersion and versionPolicy, and returns their their schema info ordered from highest version to lowest version.

◆ GetAPISchemaCanOnlyApplyToTypeNames()

static USD_API const TfTokenVector & GetAPISchemaCanOnlyApplyToTypeNames ( const TfToken apiSchemaName,
const TfToken instanceName = TfToken() 
)
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.

◆ GetAPISchemaTypeName()

static USD_API TfToken GetAPISchemaTypeName ( const TfType schemaType)
static

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

◆ GetAPITypeFromSchemaTypeName()

static USD_API TfType 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.

◆ GetAutoApplyAPISchemas()

static USD_API const TokenToTokenVectorMap & GetAutoApplyAPISchemas ( )
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.

◆ GetConcreteSchemaTypeName()

static USD_API TfToken GetConcreteSchemaTypeName ( const TfType schemaType)
static

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

◆ GetConcreteTypeFromSchemaTypeName()

static USD_API TfType 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.

◆ GetEmptyPrimDefinition()

const UsdPrimDefinition * GetEmptyPrimDefinition ( ) const
inline

Returns the empty prim definition.

Definition at line 533 of file schemaRegistry.h.

◆ GetFallbackPrimTypes()

const VtDictionary & 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
Fallback Prim Types

Definition at line 557 of file schemaRegistry.h.

◆ GetInstance()

static USD_API UsdSchemaRegistry & GetInstance ( )
inlinestatic

Definition at line 105 of file schemaRegistry.h.

◆ GetMultipleApplyNameTemplateBaseName()

static USD_API TfToken GetMultipleApplyNameTemplateBaseName ( const std::string &  nameTemplate)
static

Returns the base name for the multiple apply schema name template nameTemplate.

The base name is the substring of the given name template that comes after the instance name placeholder and the subsequent namespace delimiter. If the given property name does not contain the instance name placeholder, it is not a name template and the name template is returned as is.

◆ GetSchemaKind() [1/2]

static USD_API UsdSchemaKind GetSchemaKind ( const TfToken typeName)
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.

◆ GetSchemaKind() [2/2]

static USD_API UsdSchemaKind GetSchemaKind ( const TfType schemaType)
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.

◆ GetSchemaTypeName() [1/2]

static TfToken GetSchemaTypeName ( )
inlinestatic

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

Definition at line 245 of file schemaRegistry.h.

◆ GetSchemaTypeName() [2/2]

static USD_API TfToken GetSchemaTypeName ( const TfType schemaType)
static

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

◆ GetTypeFromName()

static USD_API TfType 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.

# This code attempts to match all prims on a stage to a given
# user specified type, making the traditional schema based idioms not
# applicable.
data = parser.parse_args()
matchedPrims = [p for p in stage.Traverse() if p.IsA(tfType)]
static USD_API TfType GetTypeFromName(const TfToken &typeName)
Finds the TfType of a schema with typeName.
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.

◆ GetTypeFromSchemaTypeName()

static USD_API TfType 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.

◆ GetTypeNameAndInstance()

static USD_API std::pair< TfToken, TfToken > GetTypeNameAndInstance ( const TfToken apiSchemaName)
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.

See also
UsdPrim::AddAppliedSchema(const TfToken&) const
UsdPrim::GetAppliedSchemas() const

◆ IsAbstract() [1/2]

static USD_API bool IsAbstract ( const TfToken primType)
static

Returns true if the prim type primType is an abstract schema type and, unlike a concrete type, is not instantiable in scene description.

◆ IsAbstract() [2/2]

static USD_API bool IsAbstract ( const TfType primType)
static

Returns true if the prim type primType is an abstract schema type and, unlike a concrete type, is not instantiable in scene description.

◆ IsAllowedAPISchemaInstanceName()

static USD_API bool IsAllowedAPISchemaInstanceName ( const TfToken apiSchemaName,
const TfToken instanceName 
)
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.

◆ IsAllowedSchemaFamily()

static USD_API bool IsAllowedSchemaFamily ( const TfToken schemaFamily)
static

Returns whether the given schemaFamily is an allowed schema family name.

A schema family is allowed if it's a valid identifier and does not itself contain a version suffix.

◆ IsAllowedSchemaIdentifier()

static USD_API bool IsAllowedSchemaIdentifier ( const TfToken schemaIdentifier)
static

Returns whether the given schemaIdentifier is an allowed schema identifier.

A schema identifier is allowed if it can be
parsed into a allowed schema family and schema version and it is the identifier that would be created from that parsed family and version.

◆ IsAppliedAPISchema() [1/2]

static USD_API bool IsAppliedAPISchema ( const TfToken apiSchemaType)
static

Returns true if apiSchemaType is an applied API schema type.

◆ IsAppliedAPISchema() [2/2]

static USD_API bool IsAppliedAPISchema ( const TfType apiSchemaType)
static

Returns true if apiSchemaType is an applied API schema type.

◆ IsConcrete() [1/2]

static USD_API bool IsConcrete ( const TfToken primType)
static

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

◆ IsConcrete() [2/2]

static USD_API bool IsConcrete ( const TfType primType)
static

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

◆ IsDisallowedField()

static USD_API bool 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.

◆ IsMultipleApplyAPISchema() [1/2]

static USD_API bool IsMultipleApplyAPISchema ( const TfToken apiSchemaType)
static

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

◆ IsMultipleApplyAPISchema() [2/2]

static USD_API bool IsMultipleApplyAPISchema ( const TfType apiSchemaType)
static

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

◆ IsMultipleApplyNameTemplate()

static USD_API bool IsMultipleApplyNameTemplate ( const std::string &  nameTemplate)
static

Returns true if nameTemplate is a multiple apply schema name template.

The given nameTemplate is a name template if and only if it contains the instance name place holder "__INSTANCE_NAME__" as an exact match as one of the tokenized components of the name tokenized by the namespace delimiter.

◆ IsTyped()

static USD_API bool IsTyped ( const TfType primType)
static

Returns true if the prim type primType inherits from UsdTyped.

◆ MakeMultipleApplyNameInstance()

static USD_API TfToken MakeMultipleApplyNameInstance ( const std::string &  nameTemplate,
const std::string &  instanceName 
)
static

Returns an instance of a multiple apply schema name from the given nameTemplate for the given instanceName.

The returned name is created by replacing the instance name placeholder "__INSTANCE_NAME__" in the name template with the given instance name. If the instance name placeholder is not found in nameTemplate, then the name template is not multiple apply name template and is returned as is.

Note that the instance name placeholder must be found as an exact full word match with one of the tokenized components of the name template, when tokenized by the namespace delimiter, in order for it to be treated as a placeholder and substituted with the instance name.

◆ MakeMultipleApplyNameTemplate()

static USD_API TfToken MakeMultipleApplyNameTemplate ( const std::string &  namespacePrefix,
const std::string &  baseName 
)
static

Creates a name template that can represent a property or API schema that belongs to a multiple apply schema and will therefore have multiple instances with different names.

The name template is created by joining the namespacePrefix, the instance name placeholder "__INSTANCE_NAME__", and the baseName using the namespace delimiter. Therefore the returned name template will be of one of the following forms depending on whether either of the inputs is empty:

  1. namespacePrefix:INSTANCE_NAME:baseName
  2. namespacePrefix:INSTANCE_NAME
  3. INSTANCE_NAME:baseName
  4. INSTANCE_NAME

Name templates can be passed to MakeMultipleApplyNameInstance along with an instance name to create the name for a particular instance.

◆ MakeSchemaIdentifierForFamilyAndVersion()

static USD_API TfToken MakeSchemaIdentifierForFamilyAndVersion ( const TfToken schemaFamily,
UsdSchemaVersion  schemaVersion 
)
static

Creates the schema identifier that would be used to define a schema of the given schemaFamily with the given schemaVersion.

If the provided schema version is zero, the returned identifier will be the schema family itself. For all other versions, the returned identifier will be the family followed by an underscore and the version number.

If schemaFamily is not an allowed schema family, this function will append the appropriate version suffix, but the returned identifier will not be an allowed schema identifier.

◆ ParseSchemaFamilyAndVersionFromIdentifier()

static USD_API std::pair< TfToken, UsdSchemaVersion > ParseSchemaFamilyAndVersionFromIdentifier ( const TfToken schemaIdentifier)
static

Parses and returns the schema family and version values from the given schemaIdentifier.

A schema identifier's version is indicated by a suffix consisting of an underscore followed by a positive integer which is its version. The schema family is the string before this suffix. If the identifier does not have a suffix matching this pattern, then the schema version is zero and the schema family is the identifier itself.

For example: Identifier "FooAPI_1" returns ("FooAPI", 1) Identifier "FooAPI" returns ("FooAPI", 0)

Note that this function only parses what the schema family and version would be for the given schema identifier and does not require that schemaIdentifier be a registered schema itself or even an allowed schema identifier.

Friends And Related Function Documentation

◆ TfSingleton< UsdSchemaRegistry >

friend class TfSingleton< UsdSchemaRegistry >
friend

Definition at line 557 of file schemaRegistry.h.

◆ UsdPrimDefinition

friend class UsdPrimDefinition
friend

Definition at line 595 of file schemaRegistry.h.


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