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

#include <primDefinition.h>

Classes

class  Attribute
 
class  Property
 
class  Relationship
 

Public Member Functions

 ~UsdPrimDefinition ()=default
 
const TfTokenVectorGetPropertyNames () const
 Return the list of names of builtin properties for this prim definition. More...
 
const TfTokenVectorGetAppliedAPISchemas () const
 
USD_API Property GetPropertyDefinition (const TfToken &propName) const
 
USD_API Attribute GetAttributeDefinition (const TfToken &attrName) const
 
USD_API Relationship GetRelationshipDefinition (const TfToken &relName) const
 
USD_API SdfSpecType GetSpecType (const TfToken &propName) const
 
USD_API SdfPropertySpecHandle GetSchemaPropertySpec (const TfToken &propName) const
 
USD_API SdfAttributeSpecHandle GetSchemaAttributeSpec (const TfToken &attrName) const
 
USD_API SdfRelationshipSpecHandle GetSchemaRelationshipSpec (const TfToken &relName) const
 
template<class T >
bool GetAttributeFallbackValue (const TfToken &attrName, T *value) const
 
USD_API 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
 
USD_API 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
 
USD_API bool FlattenTo (const SdfLayerHandle &layer, const SdfPath &path, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) const
 
USD_API UsdPrim FlattenTo (const UsdPrim &parent, const TfToken &name, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) const
 
USD_API UsdPrim FlattenTo (const UsdPrim &prim, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) 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 48 of file primDefinition.h.

Constructor & Destructor Documentation

UsdPrimDefinition::~UsdPrimDefinition ( )
default

Member Function Documentation

USD_API bool UsdPrimDefinition::FlattenTo ( const SdfLayerHandle &  layer,
const SdfPath path,
SdfSpecifier  newSpecSpecifier = SdfSpecifierOver 
) const

Copies the contents of this prim definition to a prim spec on the given layer at the given path. This includes the entire property spec for each of this definition's built-in properties as well as all of this definition's prim metadata.

If the prim definition represents a concrete prim type, the type name of the prim spec is set to the the type name of this prim definition. Otherwise the type name is set to empty. The 'apiSchemas' metadata on the prim spec will always be explicitly set to the combined list of all API schemas applied to this prim definition, i.e. the list returned by UsdPrimDefinition::GetAppliedAPISchemas. Note that if this prim definition is an API schema prim definition (see UsdSchemaRegistry::FindAppliedAPIPrimDefinition) then 'apiSchemas' will be empty as this prim definition does not "have" an applied API because instead it "is" an applied API.

If there is no prim spec at the given path, a new prim spec is created at that path with the specifier newSpecSpecifier. Any necessary ancestor specs will be created as well but they will always be created as overs. If a spec does exist at path, then all of its properties and schema allowed metadata are cleared before it is populated from the prim definition.

USD_API UsdPrim UsdPrimDefinition::FlattenTo ( const UsdPrim parent,
const TfToken name,
SdfSpecifier  newSpecSpecifier = SdfSpecifierOver 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Copies the contents of this prim definition to a prim spec at the current edit target for a prim with the given name under the prim parent.

USD_API UsdPrim UsdPrimDefinition::FlattenTo ( const UsdPrim prim,
SdfSpecifier  newSpecSpecifier = SdfSpecifierOver 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Copies the contents of this prim definition to a prim spec at the current edit target for the given prim.

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 58 of file primDefinition.h.

USD_API Attribute UsdPrimDefinition::GetAttributeDefinition ( const TfToken attrName) const

Returns an attribute accessor the property named attrName if it is defined by this this prim definition and is an attribute. If a property with the given name doesn't exist or exists but isn't an attribute, this will return an invalid Attribute.

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 328 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 345 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 362 of file primDefinition.h.

USD_API Property UsdPrimDefinition::GetPropertyDefinition ( const TfToken propName) const

Returns a property accessor the property named propName if it is defined by this this prim definition. If a property with the given name doesn't exist, this will return an invalid Property.

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 389 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 407 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 54 of file primDefinition.h.

USD_API Relationship UsdPrimDefinition::GetRelationshipDefinition ( const TfToken relName) const

Returns a relationship accessor the property named relName if it is defined by this this prim definition and is a relationship. If a property with the given name doesn't exist or exists but isn't a relationship, this will return an invalid Relationship.

USD_API SdfAttributeSpecHandle UsdPrimDefinition::GetSchemaAttributeSpec ( const TfToken attrName) const
Deprecated:
Use GetAttributeDefinition instead.

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

USD_API SdfPropertySpecHandle UsdPrimDefinition::GetSchemaPropertySpec ( const TfToken propName) const
Deprecated:
Use GetPropertyDefinition instead.

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.

USD_API SdfRelationshipSpecHandle UsdPrimDefinition::GetSchemaRelationshipSpec ( const TfToken relName) const
Deprecated:
Use GetRelationshipDefinition instead.

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

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

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

USD_API TfTokenVector UsdPrimDefinition::ListMetadataFields ( ) const

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

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

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

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 476 of file primDefinition.h.

friend class UsdSchemaRegistry
friend

Definition at line 468 of file primDefinition.h.


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