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

#include <primDefinition.h>

Public Member Functions

 ~UsdPrimDefinition ()=default
 
const TfTokenVectorGetPropertyNames () const
 Return the list of names of builtin properties for this prim definition. More...
 
const TfTokenVectorGetAppliedAPISchemas () const
 
SdfSpecType GetSpecType (const TfToken &propName) const
 
SdfPrimSpecHandle GetSchemaPrimSpec () const
 
SdfPropertySpecHandle GetSchemaPropertySpec (const TfToken &propName) const
 
SdfAttributeSpecHandle GetSchemaAttributeSpec (const TfToken &attrName) const
 
SdfRelationshipSpecHandle GetSchemaRelationshipSpec (const TfToken &relName) const
 
template<class T >
bool GetAttributeFallbackValue (const TfToken &attrName, T *value) const
 
TfTokenVector ListMetadataFields () const
 
template<class T >
bool GetMetadata (const TfToken &key, T *value) const
 
template<class T >
bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, T *value) const
 
USD_API std::string GetDocumentation () const
 
TfTokenVector ListPropertyMetadataFields (const TfToken &propName) const
 
template<class T >
bool GetPropertyMetadata (const TfToken &propName, const TfToken &key, T *value) const
 
template<class T >
bool GetPropertyMetadataByDictKey (const TfToken &propName, const TfToken &key, const TfToken &keyPath, T *value) const
 
USD_API std::string GetPropertyDocumentation (const TfToken &propName) const
 

Friends

class UsdSchemaRegistry
 
template<class T >
bool Usd_GetFallbackValue (const UsdPrimDefinition &primDef, const TfToken &propName, const TfToken &fieldName, const TfToken &keyPath, T *value)
 

Detailed Description

Class representing the builtin definition of a prim given the schemas registered in the schema registry. It provides access to the the builtin properties and metadata of a prim whose type is defined by this definition.

Instances of this class can only be created by the UsdSchemaRegistry.

Definition at line 45 of file primDefinition.h.

Constructor & Destructor Documentation

UsdPrimDefinition::~UsdPrimDefinition ( )
default

Member Function Documentation

const TfTokenVector& UsdPrimDefinition::GetAppliedAPISchemas ( ) const
inline

Return the list of names of the API schemas that have been applied to this prim definition in order.

Definition at line 55 of file primDefinition.h.

template<class T >
bool UsdPrimDefinition::GetAttributeFallbackValue ( const TfToken attrName,
T value 
) const
inline

Retrieves the fallback value for the attribute named attrName and stores it in value if possible.

Returns true if the attribute exists in this prim definition and it has a fallback value defined. Returns false otherwise.

Definition at line 117 of file primDefinition.h.

USD_API std::string UsdPrimDefinition::GetDocumentation ( ) const

Returns the documentation metadata defined by the prim definition for the prim itself.

template<class T >
bool UsdPrimDefinition::GetMetadata ( const TfToken key,
T value 
) const
inline

Retrieves the fallback value for the metadata field named key, that is defined by this prim definition for the prim itself and stores it in value if possible.

Returns true if a fallback value is defined for the given metadata key. Returns false otherwise.

Definition at line 136 of file primDefinition.h.

template<class T >
bool UsdPrimDefinition::GetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
T value 
) const
inline

Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field named key, that is defined by this prim definition for the prim itself, and stores it in value if possible.

Returns true if a fallback dictionary value is defined for the given metadata key and it contains a value at keyPath. Returns false otherwise.

Definition at line 153 of file primDefinition.h.

USD_API std::string UsdPrimDefinition::GetPropertyDocumentation ( const TfToken propName) const

Returns the documentation metadata defined by the prim definition for the property named propName if it exists.

template<class T >
bool UsdPrimDefinition::GetPropertyMetadata ( const TfToken propName,
const TfToken key,
T value 
) const
inline

Retrieves the fallback value for the metadata field named key, that is defined by this prim definition for the property named propName, and stores it in value if possible.

Returns true if a fallback value is defined for the given metadata key for the named property. Returns false otherwise.

Definition at line 183 of file primDefinition.h.

template<class T >
bool UsdPrimDefinition::GetPropertyMetadataByDictKey ( const TfToken propName,
const TfToken key,
const TfToken keyPath,
T value 
) const
inline

Retrieves the value at keyPath from the fallback dictionary value for the dictionary metadata field named key, that is defined by this prim definition for the property named propName, and stores it in value if possible.

Returns true if a fallback dictionary value is defined for the given metadata key for the named property and it contains a value at keyPath. Returns false otherwise.

Definition at line 201 of file primDefinition.h.

const TfTokenVector& UsdPrimDefinition::GetPropertyNames ( ) const
inline

Return the list of names of builtin properties for this prim definition.

Definition at line 51 of file primDefinition.h.

SdfAttributeSpecHandle UsdPrimDefinition::GetSchemaAttributeSpec ( const TfToken attrName) const
inline

This is a convenience method. It is shorthand for TfDynamic_cast<SdfAttributeSpecHandle>( GetSchemaPropertySpec(primType, attrName));

Definition at line 92 of file primDefinition.h.

SdfPrimSpecHandle UsdPrimDefinition::GetSchemaPrimSpec ( ) const
inline
Deprecated:
Please use the API on UsdPrimDefinition itself to inquire about metadata and properties.

Returns the prim spec in the registered schematics that represents this prim definition's prim type. This will be null for invalid prim types or definitions composed for a prim with applied API schemas.

Definition at line 76 of file primDefinition.h.

SdfPropertySpecHandle UsdPrimDefinition::GetSchemaPropertySpec ( const TfToken propName) const
inline

Return the property spec that defines the fallback for the property named propName on prims of this prim definition's type. Return null if there is no such property spec.

Definition at line 81 of file primDefinition.h.

SdfRelationshipSpecHandle UsdPrimDefinition::GetSchemaRelationshipSpec ( const TfToken relName) const
inline

This is a convenience method. It is shorthand for TfDynamic_cast<SdfRelationshipSpecHandle>( GetSchemaPropertySpec(primType, relName));

Definition at line 103 of file primDefinition.h.

SdfSpecType UsdPrimDefinition::GetSpecType ( const TfToken propName) const
inline

Return the SdfSpecType for propName if it is a builtin property of the prim type represented by this prim definition. Otherwise return SdfSpecTypeUnknown.

Definition at line 62 of file primDefinition.h.

TfTokenVector UsdPrimDefinition::ListMetadataFields ( ) const
inline

Returns the list of names of metadata fields that are defined by this prim definition for the prim itself.

Definition at line 124 of file primDefinition.h.

TfTokenVector UsdPrimDefinition::ListPropertyMetadataFields ( const TfToken propName) const
inline

Returns the list of names of metadata fields that are defined by this prim definition for property propName if a property named propName exists.

Definition at line 170 of file primDefinition.h.

Friends And Related Function Documentation

template<class T >
bool Usd_GetFallbackValue ( const UsdPrimDefinition primDef,
const TfToken propName,
const TfToken fieldName,
const TfToken keyPath,
T value 
)
friend

Definition at line 226 of file primDefinition.h.

friend class UsdSchemaRegistry
friend

Definition at line 218 of file primDefinition.h.


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