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

#include <property.h>

+ Inheritance diagram for UsdProperty:

Public Member Functions

 UsdProperty ()
 Construct an invalid property. More...
 
Object and Namespace Accessors
USD_API SdfPropertySpecHandleVector GetPropertyStack (UsdTimeCode time=UsdTimeCode::Default()) const
 
USD_API std::vector< std::pair
< SdfPropertySpecHandle,
SdfLayerOffset > > 
GetPropertyStackWithLayerOffsets (UsdTimeCode time=UsdTimeCode::Default()) const
 
USD_API TfToken GetBaseName () const
 
USD_API TfToken GetNamespace () const
 
USD_API std::vector< std::stringSplitName () const
 
Core Metadata
USD_API std::string GetDisplayGroup () const
 
USD_API bool SetDisplayGroup (const std::string &displayGroup) const
 
USD_API bool ClearDisplayGroup () const
 
USD_API bool HasAuthoredDisplayGroup () const
 
USD_API std::vector< std::stringGetNestedDisplayGroups () const
 
USD_API bool SetNestedDisplayGroups (const std::vector< std::string > &nestedGroups) const
 
USD_API bool IsCustom () const
 
USD_API bool SetCustom (bool isCustom) const
 
Existence and Validity
USD_API bool IsDefined () const
 
USD_API bool IsAuthored () const
 
USD_API bool IsAuthoredAt (const class UsdEditTarget &editTarget) const
 
- Public Member Functions inherited from UsdObject
 UsdObject ()
 Default constructor produces an invalid object. More...
 
template<typename T >
bool GetMetadata (const TfToken &key, T *value) const
 
USD_API bool GetMetadata (const TfToken &key, VtValue *value) const
 
template<typename T >
bool SetMetadata (const TfToken &key, const T &value) const
 
USD_API bool SetMetadata (const TfToken &key, const VtValue &value) const
 
USD_API bool ClearMetadata (const TfToken &key) const
 
USD_API bool HasMetadata (const TfToken &key) const
 
USD_API bool HasAuthoredMetadata (const TfToken &key) const
 
template<class T >
bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, T *value) const
 
USD_API bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, VtValue *value) const
 
template<typename T >
bool SetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, const T &value) const
 
USD_API bool SetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, const VtValue &value) const
 
USD_API bool ClearMetadataByDictKey (const TfToken &key, const TfToken &keyPath) const
 
USD_API bool HasMetadataDictKey (const TfToken &key, const TfToken &keyPath) const
 
USD_API bool HasAuthoredMetadataDictKey (const TfToken &key, const TfToken &keyPath) const
 
USD_API UsdMetadataValueMap GetAllMetadata () const
 
USD_API UsdMetadataValueMap GetAllAuthoredMetadata () const
 
USD_API bool IsHidden () const
 
USD_API bool SetHidden (bool hidden) const
 
USD_API bool ClearHidden () const
 Clears the opinion for "Hidden" at the current EditTarget. More...
 
USD_API bool HasAuthoredHidden () const
 
USD_API VtDictionary GetCustomData () const
 
USD_API VtValue GetCustomDataByKey (const TfToken &keyPath) const
 
USD_API void SetCustomData (const VtDictionary &customData) const
 
USD_API void SetCustomDataByKey (const TfToken &keyPath, const VtValue &value) const
 
USD_API void ClearCustomData () const
 
USD_API void ClearCustomDataByKey (const TfToken &keyPath) const
 
USD_API bool HasCustomData () const
 
USD_API bool HasCustomDataKey (const TfToken &keyPath) const
 
USD_API bool HasAuthoredCustomData () const
 
USD_API bool HasAuthoredCustomDataKey (const TfToken &keyPath) const
 
USD_API VtDictionary GetAssetInfo () const
 
USD_API VtValue GetAssetInfoByKey (const TfToken &keyPath) const
 
USD_API void SetAssetInfo (const VtDictionary &customData) const
 
USD_API void SetAssetInfoByKey (const TfToken &keyPath, const VtValue &value) const
 
USD_API void ClearAssetInfo () const
 
USD_API void ClearAssetInfoByKey (const TfToken &keyPath) const
 
USD_API bool HasAssetInfo () const
 
USD_API bool HasAssetInfoKey (const TfToken &keyPath) const
 
USD_API bool HasAuthoredAssetInfo () const
 
USD_API bool HasAuthoredAssetInfoKey (const TfToken &keyPath) const
 
USD_API std::string GetDocumentation () const
 
USD_API bool SetDocumentation (const std::string &doc) const
 Sets this object's documentation (metadata). Returns true on success. More...
 
USD_API bool ClearDocumentation () const
 
USD_API bool HasAuthoredDocumentation () const
 
USD_API std::string GetDisplayName () const
 
USD_API bool SetDisplayName (const std::string &name) const
 
USD_API bool ClearDisplayName () const
 
USD_API bool HasAuthoredDisplayName () const
 
bool IsValid () const
 Return true if this is a valid object, false otherwise. More...
 
 operator bool () const
 Returns true if this object is valid, false otherwise. More...
 
USD_API UsdStageWeakPtr GetStage () const
 
SdfPath GetPath () const
 
const SdfPathGetPrimPath () const
 
UsdPrim GetPrim () const
 
const TfTokenGetName () const
 
template<class T >
T As () const
 
template<class T >
bool Is () const
 
USD_API std::string GetDescription () const
 

Flattening

class UsdAttribute
 
class UsdObject
 
class UsdPrim
 
class UsdRelationship
 
class Usd_PrimData
 
USD_API UsdProperty FlattenTo (const UsdPrim &parent) const
 
USD_API UsdProperty FlattenTo (const UsdPrim &parent, const TfToken &propName) const
 
USD_API UsdProperty FlattenTo (const UsdProperty &property) const
 
template<class Derived >
 UsdProperty (_Null< Derived >)
 
bool _GetTargets (SdfSpecType specType, SdfPathVector *out, bool *foundErrors=nullptr) const
 

Additional Inherited Members

- Static Public Member Functions inherited from UsdObject
static char GetNamespaceDelimiter ()
 
- Protected Member Functions inherited from UsdObject
template<class Derived >
 UsdObject (_Null< Derived >)
 
 UsdObject (const Usd_PrimDataHandle &prim, const SdfPath &proxyPrimPath)
 
 UsdObject (UsdObjType objType, const Usd_PrimDataHandle &prim, const SdfPath &proxyPrimPath, const TfToken &propName)
 
UsdStage_GetStage () const
 
USD_API SdfSpecType _GetDefiningSpecType () const
 
const Usd_PrimDataHandle_Prim () const
 
const TfToken_PropName () const
 
const SdfPath_ProxyPrimPath () const
 

Detailed Description

Base class for UsdAttribute and UsdRelationship scenegraph objects.

UsdProperty has a bool conversion operator that validates that the property IsDefined() and thus valid for querying and authoring values and metadata. This is a fairly expensive query that we do not cache, so if client code retains UsdProperty objects it should manage its object validity closely for performance. An ideal pattern is to listen for UsdNotice::StageContentsChanged notifications, and revalidate/refetch retained UsdObjects only then and otherwise use them without validity checking.

Definition at line 55 of file property.h.

Constructor & Destructor Documentation

UsdProperty::UsdProperty ( )
inline

Construct an invalid property.

Definition at line 58 of file property.h.

template<class Derived >
UsdProperty::UsdProperty ( _Null< Derived >  )
inlineprotected

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 276 of file property.h.

Member Function Documentation

bool UsdProperty::_GetTargets ( SdfSpecType  specType,
SdfPathVector out,
bool *  foundErrors = nullptr 
) const
protected

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten
USD_API bool UsdProperty::ClearDisplayGroup ( ) const

Clears this property's display group (metadata) in the current EditTarget (only). Returns true on success.

USD_API UsdProperty UsdProperty::FlattenTo ( const UsdPrim parent) const

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten
USD_API UsdProperty UsdProperty::FlattenTo ( const UsdPrim parent,
const TfToken propName 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Flattens this property to a property spec with the given propName beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

USD_API UsdProperty UsdProperty::FlattenTo ( const UsdProperty property) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Flattens this property to a property spec for the given property in the edit target of its owning prim's stage.

The property owning prim may belong to a different stage than this property's owning stage.

USD_API TfToken UsdProperty::GetBaseName ( ) const

Return this property's name with all namespace prefixes removed, i.e. the last component of the return value of GetName()

This is generally the property's "client name"; property namespaces are often used to group related properties together. The namespace prefixes the property name but many consumers will care only about un-namespaced name, i.e. its BaseName. For more information, see Usd_Ordering

USD_API std::string UsdProperty::GetDisplayGroup ( ) const

Return this property's display group (metadata). This returns the empty token if no display group has been set.

See Also
SetDisplayGroup()
USD_API TfToken UsdProperty::GetNamespace ( ) const

Return this property's complete namespace prefix. Return the empty token if this property has no namespaces.

This is the complement of GetBaseName(), although it does not contain a trailing namespace delimiter

USD_API std::vector<std::string> UsdProperty::GetNestedDisplayGroups ( ) const

Return this property's displayGroup as a sequence of groups to be nested, or an empty vector if displayGroup is empty or not authored.

USD_API SdfPropertySpecHandleVector UsdProperty::GetPropertyStack ( UsdTimeCode  time = UsdTimeCode::Default()) const

Returns a strength-ordered list of property specs that provide opinions for this property.

If time is UsdTimeCode::Default(), or this property is a UsdRelationship (which are never affected by clips), we will not consider value clips for opinions. For any other time, for a UsdAttribute, clips whose samples may contribute an opinion will be included. These specs are ordered from strongest to weakest opinion, although if time requires interpolation between two adjacent clips, both clips will appear, sequentially.

Note
The results returned by this method are meant for debugging and diagnostic purposes. It is not advisable to retain a PropertyStack for the purposes of expedited value resolution for properties, since the makeup of an attribute's PropertyStack may itself be time-varying. To expedite repeated value resolution of attributes, you should instead retain a UsdAttributeQuery .
See Also
UsdClipsAPI
USD_API std::vector<std::pair<SdfPropertySpecHandle, SdfLayerOffset> > UsdProperty::GetPropertyStackWithLayerOffsets ( UsdTimeCode  time = UsdTimeCode::Default()) const

Returns a strength-ordered list of property specs that provide opinions for this property paired with the cumulative layer offset from the stage's root layer to the layer containing the property spec.

This behaves exactly the same as UsdProperty::GetPropertyStack with the addition of providing the cumulative layer offset of each spec's layer.

Note
The results returned by this method are meant for debugging and diagnostic purposes. It is not advisable to retain a PropertyStack for the purposes of expedited value resolution for properties, since the makeup of an attribute's PropertyStack may itself be time-varying. To expedite repeated value resolution of attributes, you should instead retain a UsdAttributeQuery .
USD_API bool UsdProperty::HasAuthoredDisplayGroup ( ) const

Returns true if displayGroup was explicitly authored and GetMetadata() will return a meaningful value for displayGroup.

USD_API bool UsdProperty::IsAuthored ( ) const

Return true if there are any authored opinions for this property in any layer that contributes to this stage, false otherwise.

USD_API bool UsdProperty::IsAuthoredAt ( const class UsdEditTarget editTarget) const

Return true if there is an SdfPropertySpec authored for this property at the given editTarget, otherwise return false. Note that this method does not do partial composition. It does not consider whether authored scene description exists at editTarget or weaker, only exactly at the given editTarget.

USD_API bool UsdProperty::IsCustom ( ) const

Return true if this is a custom property (i.e., not part of a prim schema).

The 'custom' modifier in USD serves the same function as Alembic's 'userProperties', which is to say as a categorization for ad hoc client data not formalized into any schema, and therefore not carrying an expectation of specific processing by consuming applications.

USD_API bool UsdProperty::IsDefined ( ) const

Return true if this is a builtin property or if the strongest authored SdfPropertySpec for this property's path matches this property's dynamic type. That is, SdfRelationshipSpec in case this is a UsdRelationship, and SdfAttributeSpec in case this is a UsdAttribute. Return false if this property's prim has expired.

For attributes, a true return does not imply that this attribute possesses a value, only that has been declared, is of a certain type and variability, and that it is safe to use to query and author values and metadata.

USD_API bool UsdProperty::SetCustom ( bool  isCustom) const

Set the value for custom at the current EditTarget, return true on success, false if the value can not be written.

Note that this value should not be changed as it is typically either automatically authored or provided by a property definition. This method is provided primarily for fixing invalid scene description.

USD_API bool UsdProperty::SetDisplayGroup ( const std::string displayGroup) const

Sets this property's display group (metadata). Returns true on success.

DisplayGroup provides UI hinting for grouping related properties together for display. We define a convention for specifying nesting of groups by recognizing the property namespace separator in displayGroup as denoting group-nesting.

See Also
SetNestedDisplayGroups()
USD_API bool UsdProperty::SetNestedDisplayGroups ( const std::vector< std::string > &  nestedGroups) const

Sets this property's display group (metadata) to the nested sequence. Returns true on success.

A displayGroup set with this method can still be retrieved with GetDisplayGroup(), with the namespace separator embedded in the result. If nestedGroups is empty, we author an empty string for displayGroup.

See Also
SetDisplayGroup()
USD_API std::vector<std::string> UsdProperty::SplitName ( ) const

Return this property's name elements including namespaces and its base name as the final element.

Friends And Related Function Documentation

friend class Usd_PrimData
friend

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 289 of file property.h.

friend class UsdAttribute
friend

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 285 of file property.h.

friend class UsdObject
friend

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 286 of file property.h.

friend class UsdPrim
friend

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 287 of file property.h.

friend class UsdRelationship
friend

Flattens this property to a property spec with the same name beneath the given parent prim in the edit target of its owning stage.

The parent prim may belong to a different stage than this property's owning stage.

Flattening authors all authored resolved values and metadata for this property into the destination property spec. If this property is a builtin property, fallback values and metadata will also be authored if the destination property has a different fallback value or no fallback value, or if the destination property has an authored value that overrides its fallback.

Attribute connections and relationship targets that target an object beneath this property's owning prim will be remapped to target objects beneath the destination parent prim.

If the destination spec already exists, it will be overwritten.

See Also
UsdStage::Flatten

Definition at line 288 of file property.h.


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