All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UsdObject Class Reference

Base class for Usd scenegraph objects, providing common API. More...

#include <object.h>

+ Inheritance diagram for UsdObject:

Public Member Functions

 UsdObject ()
 Default constructor produces an invalid object.
 
Generic Metadata Access
template<typename T >
bool GetMetadata (const TfToken &key, T *value) const
 Resolve the requested metadatum named key into value, returning true on success.
 
USD_API bool GetMetadata (const TfToken &key, VtValue *value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Type-erased access.
 
template<typename T >
bool SetMetadata (const TfToken &key, const T &value) const
 Set metadatum key's value to value.
 
USD_API bool SetMetadata (const TfToken &key, const VtValue &value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USD_API bool ClearMetadata (const TfToken &key) const
 Clears the authored key's value at the current EditTarget, returning false on error.
 
USD_API bool HasMetadata (const TfToken &key) const
 Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value, either because it was authored or because a prim's metadata fallback will be provided.
 
USD_API bool HasAuthoredMetadata (const TfToken &key) const
 Returns true if the key has an authored value, false if no value was authored or the only value available is a prim's metadata fallback.
 
template<class T >
bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, T *value) const
 Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key into value, returning true on success.
 
USD_API bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, VtValue *value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
bool SetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, const T &value) const
 Author value to the field identified by key and keyPath at the current EditTarget.
 
USD_API bool SetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, const VtValue &value) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
USD_API bool ClearMetadataByDictKey (const TfToken &key, const TfToken &keyPath) const
 Clear any authored value identified by key and keyPath at the current EditTarget.
 
USD_API bool HasMetadataDictKey (const TfToken &key, const TfToken &keyPath) const
 Return true if there exists any authored or fallback opinion for key and keyPath.
 
USD_API bool HasAuthoredMetadataDictKey (const TfToken &key, const TfToken &keyPath) const
 Return true if there exists any authored opinion (excluding fallbacks) for key and keyPath.
 
USD_API UsdMetadataValueMap GetAllMetadata () const
 Resolve and return all metadata (including both authored and fallback values) on this object, sorted lexicographically.
 
USD_API UsdMetadataValueMap GetAllAuthoredMetadata () const
 Resolve and return all user-authored metadata on this object, sorted lexicographically.
 
Core metadata fields
USD_API bool IsHidden () const
 Gets the value of the 'hidden' metadata field, false if not authored.
 
USD_API bool SetHidden (bool hidden) const
 Sets the value of the 'hidden' metadata field.
 
USD_API bool ClearHidden () const
 Clears the opinion for "Hidden" at the current EditTarget.
 
USD_API bool HasAuthoredHidden () const
 Returns true if hidden was explicitly authored and GetMetadata() will return a meaningful value for Hidden.
 
USD_API VtDictionary GetCustomData () const
 Return this object's composed customData dictionary.
 
USD_API VtValue GetCustomDataByKey (const TfToken &keyPath) const
 Return the element identified by keyPath in this object's composed customData dictionary.
 
USD_API void SetCustomData (const VtDictionary &customData) const
 Author this object's customData dictionary to customData at the current EditTarget.
 
USD_API void SetCustomDataByKey (const TfToken &keyPath, const VtValue &value) const
 Author the element identified by keyPath in this object's customData dictionary at the current EditTarget.
 
USD_API void ClearCustomData () const
 Clear the authored opinion for this object's customData dictionary at the current EditTarget.
 
USD_API void ClearCustomDataByKey (const TfToken &keyPath) const
 Clear the authored opinion identified by keyPath in this object's customData dictionary at the current EditTarget.
 
USD_API bool HasCustomData () const
 Return true if there are any authored or fallback opinions for this object's customData dictionary, false otherwise.
 
USD_API bool HasCustomDataKey (const TfToken &keyPath) const
 Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's customData dictionary, false otherwise.
 
USD_API bool HasAuthoredCustomData () const
 Return true if there are any authored opinions (excluding fallback) for this object's customData dictionary, false otherwise.
 
USD_API bool HasAuthoredCustomDataKey (const TfToken &keyPath) const
 Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's customData dictionary, false otherwise.
 
USD_API VtDictionary GetAssetInfo () const
 Return this object's composed assetInfo dictionary.
 
USD_API VtValue GetAssetInfoByKey (const TfToken &keyPath) const
 Return the element identified by keyPath in this object's composed assetInfo dictionary.
 
USD_API void SetAssetInfo (const VtDictionary &customData) const
 Author this object's assetInfo dictionary to assetInfo at the current EditTarget.
 
USD_API void SetAssetInfoByKey (const TfToken &keyPath, const VtValue &value) const
 Author the element identified by keyPath in this object's assetInfo dictionary at the current EditTarget.
 
USD_API void ClearAssetInfo () const
 Clear the authored opinion for this object's assetInfo dictionary at the current EditTarget.
 
USD_API void ClearAssetInfoByKey (const TfToken &keyPath) const
 Clear the authored opinion identified by keyPath in this object's assetInfo dictionary at the current EditTarget.
 
USD_API bool HasAssetInfo () const
 Return true if there are any authored or fallback opinions for this object's assetInfo dictionary, false otherwise.
 
USD_API bool HasAssetInfoKey (const TfToken &keyPath) const
 Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.
 
USD_API bool HasAuthoredAssetInfo () const
 Return true if there are any authored opinions (excluding fallback) for this object's assetInfo dictionary, false otherwise.
 
USD_API bool HasAuthoredAssetInfoKey (const TfToken &keyPath) const
 Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.
 
USD_API std::string GetDocumentation () const
 Return this object's documentation (metadata).
 
USD_API bool SetDocumentation (const std::string &doc) const
 Sets this object's documentation (metadata). Returns true on success.
 
USD_API bool ClearDocumentation () const
 Clears this object's documentation (metadata) in the current EditTarget (only).
 
USD_API bool HasAuthoredDocumentation () const
 Returns true if documentation was explicitly authored and GetMetadata() will return a meaningful value for documentation.
 
USD_API std::string GetDisplayName () const
 Return this object's display name (metadata).
 
USD_API bool SetDisplayName (const std::string &name) const
 Sets this object's display name (metadata).
 
USD_API bool ClearDisplayName () const
 Clears this object's display name (metadata) in the current EditTarget (only).
 
USD_API bool HasAuthoredDisplayName () const
 Returns true if displayName was explicitly authored and GetMetadata() will return a meaningful value for displayName.
 

Static Public Member Functions

static char GetNamespaceDelimiter ()
 

Protected Member Functions

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
 

Friends

class UsdStage
 

Structural and Integrity Info about the Object itself

bool operator== (const UsdObject &lhs, const UsdObject &rhs)
 Equality comparison.
 
bool operator!= (const UsdObject &lhs, const UsdObject &rhs)
 Inequality comparison.
 
bool operator< (const UsdObject &lhs, const UsdObject &rhs)
 Less-than operator.
 
size_t hash_value (const UsdObject &obj)
 
template<class HashState >
void TfHashAppend (HashState &h, const UsdObject &obj)
 
bool IsValid () const
 Return true if this is a valid object, false otherwise.
 
 operator bool () const
 Returns true if this object is valid, false otherwise.
 
USD_API UsdStageWeakPtr GetStage () const
 Return the stage that owns the object, and to whose state and lifetime this object's validity is tied.
 
SdfPath GetPath () const
 Return the complete scene path to this object on its UsdStage, which may (UsdPrim) or may not (all other subclasses) return a cached result.
 
const SdfPathGetPrimPath () const
 Return this object's path if this object is a prim, otherwise this object's nearest owning prim's path.
 
UsdPrim GetPrim () const
 Return this object if it is a prim, otherwise return this object's nearest owning prim.
 
const TfTokenGetName () const
 Return the full name of this object, i.e.
 
template<class T >
As () const
 Convert this UsdObject to another object type T if possible.
 
template<class T >
bool Is () const
 Return true if this object is convertible to T.
 
USD_API std::string GetDescription () const
 Return a string that provides a brief summary description of the object.
 

Detailed Description

Base class for Usd scenegraph objects, providing common API.

The commonality between the three types of scenegraph objects in Usd (UsdPrim, UsdAttribute, UsdRelationship) is that they can all have metadata. Other objects in the API (UsdReferences, UsdVariantSets, etc.) simply are kinds of metadata.

UsdObject's API primarily provides schema for interacting with the metadata common to all the scenegraph objects, as well as generic access to metadata.

section Usd_UsdObject_Lifetime Lifetime Management and Object Validity

Every derived class of UsdObject supports explicit detection of object validity through an explicit-bool operator, so client code should always be able use objects safely, even across edits to the owning UsdStage. UsdObject classes also perform some level of validity checking upon every use, in order to facilitate debugging of unsafe code, although we reserve the right to activate that behavior only in debug builds, if it becomes compelling to do so for performance reasons. This per-use checking will cause a fatal error upon failing the inline validity check, with an error message describing the namespace location of the dereferenced object on its owning UsdStage.

Definition at line 115 of file object.h.

Constructor & Destructor Documentation

◆ UsdObject() [1/4]

UsdObject ( )
inline

Default constructor produces an invalid object.

Definition at line 118 of file object.h.

◆ UsdObject() [2/4]

UsdObject ( _Null< Derived >  )
inlineexplicitprotected

Definition at line 677 of file object.h.

◆ UsdObject() [3/4]

UsdObject ( const Usd_PrimDataHandle &  prim,
const SdfPath proxyPrimPath 
)
inlineprotected

Definition at line 681 of file object.h.

◆ UsdObject() [4/4]

UsdObject ( UsdObjType  objType,
const Usd_PrimDataHandle &  prim,
const SdfPath proxyPrimPath,
const TfToken propName 
)
inlineprotected

Definition at line 691 of file object.h.

Member Function Documentation

◆ _GetStage()

UsdStage * _GetStage ( ) const
inlineprotected

Definition at line 704 of file object.h.

◆ _Prim()

const Usd_PrimDataHandle & _Prim ( ) const
inlineprotected

Definition at line 711 of file object.h.

◆ _PropName()

const TfToken & _PropName ( ) const
inlineprotected

Definition at line 714 of file object.h.

◆ _ProxyPrimPath()

const SdfPath & _ProxyPrimPath ( ) const
inlineprotected

Definition at line 717 of file object.h.

◆ As()

T As ( ) const
inline

Convert this UsdObject to another object type T if possible.

Return an invalid T instance if this object's dynamic type is not convertible to T or if this object is invalid.

Definition at line 229 of file object.h.

◆ ClearAssetInfo()

USD_API void ClearAssetInfo ( ) const

Clear the authored opinion for this object's assetInfo dictionary at the current EditTarget.

Do nothing if there is no such authored opinion.

◆ ClearAssetInfoByKey()

USD_API void ClearAssetInfoByKey ( const TfToken keyPath) const

Clear the authored opinion identified by keyPath in this object's assetInfo dictionary at the current EditTarget.

The keyPath is a ':'-separated path identifying a value in subdictionaries. Do nothing if there is no such authored opinion.

◆ ClearCustomData()

USD_API void ClearCustomData ( ) const

Clear the authored opinion for this object's customData dictionary at the current EditTarget.

Do nothing if there is no such authored opinion.

◆ ClearCustomDataByKey()

USD_API void ClearCustomDataByKey ( const TfToken keyPath) const

Clear the authored opinion identified by keyPath in this object's customData dictionary at the current EditTarget.

The keyPath is a ':'-separated path identifying a value in subdictionaries. Do nothing if there is no such authored opinion.

◆ ClearDisplayName()

USD_API bool ClearDisplayName ( ) const

Clears this object's display name (metadata) in the current EditTarget (only).

Returns true on success.

◆ ClearDocumentation()

USD_API bool ClearDocumentation ( ) const

Clears this object's documentation (metadata) in the current EditTarget (only).

Returns true on success.

◆ ClearHidden()

USD_API bool ClearHidden ( ) const

Clears the opinion for "Hidden" at the current EditTarget.

◆ ClearMetadata()

USD_API bool ClearMetadata ( const TfToken key) const

Clears the authored key's value at the current EditTarget, returning false on error.

If no value is present, this method is a no-op and returns true. It is considered an error to call ClearMetadata when no spec is present for this UsdObject, i.e. if the object has no presence in the current UsdEditTarget.

See also
General Metadata in USD

◆ ClearMetadataByDictKey()

USD_API bool ClearMetadataByDictKey ( const TfToken key,
const TfToken keyPath 
) const

Clear any authored value identified by key and keyPath at the current EditTarget.

The keyPath is a ':'-separated path identifying a path in subdictionaries stored in the metadata field at key. Return true if the value is cleared successfully, false otherwise.

See also
Dictionary-valued Metadata

◆ GetAllAuthoredMetadata()

USD_API UsdMetadataValueMap GetAllAuthoredMetadata ( ) const

Resolve and return all user-authored metadata on this object, sorted lexicographically.

Note
This method does not return field keys for composition arcs, such as references, inherits, payloads, sublayers, variants, or primChildren, nor does it return the default value, timeSamples, or spline.

◆ GetAllMetadata()

USD_API UsdMetadataValueMap GetAllMetadata ( ) const

Resolve and return all metadata (including both authored and fallback values) on this object, sorted lexicographically.

Note
This method does not return field keys for composition arcs, such as references, inherits, payloads, sublayers, variants, or primChildren, nor does it return the default value, timeSamples, or spline.

◆ GetAssetInfo()

USD_API VtDictionary GetAssetInfo ( ) const

Return this object's composed assetInfo dictionary.

The asset info dictionary is used to annotate objects representing the root-prims of assets (generally organized as models) with various data related to asset management. For example, asset name, root layer identifier, asset version etc.

The elements of this dictionary are composed element-wise, and are nestable.

There is no means to query an assetInfo field's valuetype other than fetching the value and interrogating it.

See also
GetAssetInfoByKey()

◆ GetAssetInfoByKey()

USD_API VtValue GetAssetInfoByKey ( const TfToken keyPath) const

Return the element identified by keyPath in this object's composed assetInfo dictionary.

The keyPath is a ':'-separated path identifying a value in subdictionaries. This is in general more efficient than composing the entire assetInfo dictionary than pulling out one sub-element.

◆ GetCustomData()

USD_API VtDictionary GetCustomData ( ) const

Return this object's composed customData dictionary.

CustomData is "custom metadata", a place for applications and users to put uniform data that is entirely dynamic and subject to no schema known to Usd. Unlike metadata like 'hidden', 'displayName' etc, which must be declared in code or a data file that is considered part of one's Usd distribution (e.g. a plugInfo.json file) to be used, customData keys and the datatypes of their corresponding values are ad hoc. No validation will ever be performed that values for the same key in different layers are of the same type - strongest simply wins.

Dictionaries like customData are composed element-wise, and are nestable.

There is no means to query a customData field's valuetype other than fetching the value and interrogating it.

See also
GetCustomDataByKey()

◆ GetCustomDataByKey()

USD_API VtValue GetCustomDataByKey ( const TfToken keyPath) const

Return the element identified by keyPath in this object's composed customData dictionary.

The keyPath is a ':'-separated path identifying a value in subdictionaries. This is in general more efficient than composing the entire customData dictionary and then pulling out one sub-element.

◆ GetDescription()

USD_API std::string GetDescription ( ) const

Return a string that provides a brief summary description of the object.

This method, along with IsValid()/bool_operator, is always safe to call on a possibly-expired object, and the description will specify whether the object is valid or expired, along with a few other bits of data.

◆ GetDisplayName()

USD_API std::string GetDisplayName ( ) const

Return this object's display name (metadata).

This returns the empty string if no display name has been set.

See also
SetDisplayName()

◆ GetDocumentation()

USD_API std::string GetDocumentation ( ) const

Return this object's documentation (metadata).

This returns the empty string if no documentation has been set.

See also
SetDocumentation()

◆ GetMetadata() [1/2]

bool GetMetadata ( const TfToken key,
T *  value 
) const
inline

Resolve the requested metadatum named key into value, returning true on success.

Returns
false if key was not resolvable, or if value's type T differed from that of the resolved metadatum.
Note
For any composition-related metadata, as enumerated in GetAllMetadata(), this method will return only the strongest opinion found, not applying the composition rules used by Pcp to process the data. For more processed/composed views of composition data, please refer to the specific interface classes, such as UsdReferences, UsdInherits, UsdVariantSets, etc.
See also
General Metadata in USD

Definition at line 739 of file object.h.

◆ GetMetadata() [2/2]

USD_API bool GetMetadata ( const TfToken key,
VtValue value 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Type-erased access.

◆ GetMetadataByDictKey() [1/2]

bool GetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
T *  value 
) const
inline

Resolve the requested dictionary sub-element keyPath of dictionary-valued metadatum named key into value, returning true on success.

If you know you neeed just a small number of elements from a dictionary, accessing them element-wise using this method can be much less expensive than fetching the entire dictionary with GetMetadata(key).

Returns
false if key was not resolvable, or if value's type T differed from that of the resolved metadatum.

The keyPath is a ':'-separated path addressing an element in subdictionaries.

See also
Dictionary-valued Metadata

Definition at line 755 of file object.h.

◆ GetMetadataByDictKey() [2/2]

USD_API bool GetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
VtValue value 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ GetName()

const TfToken & GetName ( ) const
inline

Return the full name of this object, i.e.

the last component of its SdfPath in namespace.

This is equivalent to, but generally cheaper than, GetPath().GetNameToken()

Definition at line 221 of file object.h.

◆ GetNamespaceDelimiter()

static char GetNamespaceDelimiter ( )
inlinestatic

Definition at line 650 of file object.h.

◆ GetPath()

SdfPath GetPath ( ) const
inline

Return the complete scene path to this object on its UsdStage, which may (UsdPrim) or may not (all other subclasses) return a cached result.

Definition at line 186 of file object.h.

◆ GetPrim()

UsdPrim GetPrim ( ) const
inline

Return this object if it is a prim, otherwise return this object's nearest owning prim.

Definition at line 2787 of file prim.h.

◆ GetPrimPath()

const SdfPath & GetPrimPath ( ) const
inline

Return this object's path if this object is a prim, otherwise this object's nearest owning prim's path.

Equivalent to GetPrim().GetPath().

Definition at line 201 of file object.h.

◆ GetStage()

USD_API UsdStageWeakPtr GetStage ( ) const

Return the stage that owns the object, and to whose state and lifetime this object's validity is tied.

◆ HasAssetInfo()

USD_API bool HasAssetInfo ( ) const

Return true if there are any authored or fallback opinions for this object's assetInfo dictionary, false otherwise.

◆ HasAssetInfoKey()

USD_API bool HasAssetInfoKey ( const TfToken keyPath) const

Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ HasAuthoredAssetInfo()

USD_API bool HasAuthoredAssetInfo ( ) const

Return true if there are any authored opinions (excluding fallback) for this object's assetInfo dictionary, false otherwise.

◆ HasAuthoredAssetInfoKey()

USD_API bool HasAuthoredAssetInfoKey ( const TfToken keyPath) const

Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's assetInfo dictionary, false otherwise.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ HasAuthoredCustomData()

USD_API bool HasAuthoredCustomData ( ) const

Return true if there are any authored opinions (excluding fallback) for this object's customData dictionary, false otherwise.

◆ HasAuthoredCustomDataKey()

USD_API bool HasAuthoredCustomDataKey ( const TfToken keyPath) const

Return true if there are any authored opinions (excluding fallback) for the element identified by keyPath in this object's customData dictionary, false otherwise.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ HasAuthoredDisplayName()

USD_API bool HasAuthoredDisplayName ( ) const

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


◆ HasAuthoredDocumentation()

USD_API bool HasAuthoredDocumentation ( ) const

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


◆ HasAuthoredHidden()

USD_API bool HasAuthoredHidden ( ) const

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

Note that IsHidden returns a fallback value (false) when hidden is not authored.

◆ HasAuthoredMetadata()

USD_API bool HasAuthoredMetadata ( const TfToken key) const

Returns true if the key has an authored value, false if no value was authored or the only value available is a prim's metadata fallback.

◆ HasAuthoredMetadataDictKey()

USD_API bool HasAuthoredMetadataDictKey ( const TfToken key,
const TfToken keyPath 
) const

Return true if there exists any authored opinion (excluding fallbacks) for key and keyPath.

The keyPath is a ':'-separated path identifying a value in subdictionaries stored in the metadata field at key.

See also
Dictionary-valued Metadata

◆ HasCustomData()

USD_API bool HasCustomData ( ) const

Return true if there are any authored or fallback opinions for this object's customData dictionary, false otherwise.

◆ HasCustomDataKey()

USD_API bool HasCustomDataKey ( const TfToken keyPath) const

Return true if there are any authored or fallback opinions for the element identified by keyPath in this object's customData dictionary, false otherwise.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ HasMetadata()

USD_API bool HasMetadata ( const TfToken key) const

Returns true if the key has a meaningful value, that is, if GetMetadata() will provide a value, either because it was authored or because a prim's metadata fallback will be provided.

◆ HasMetadataDictKey()

USD_API bool HasMetadataDictKey ( const TfToken key,
const TfToken keyPath 
) const

Return true if there exists any authored or fallback opinion for key and keyPath.

The keyPath is a ':'-separated path identifying a value in subdictionaries stored in the metadata field at key.

See also
Dictionary-valued Metadata

◆ Is()

bool Is ( ) const
inline

Return true if this object is convertible to T.

This is equivalent to but cheaper than:

bool(obj.As<T>())

Definition at line 240 of file object.h.

◆ IsHidden()

USD_API bool IsHidden ( ) const

Gets the value of the 'hidden' metadata field, false if not authored.

When an object is marked as hidden, it is an indicator to clients who generically display objects (such as GUI widgets) that this object should not be included, unless explicitly asked for. Although this is just a hint and thus up to each application to interpret, we use it primarily as a way of simplifying hierarchy displays, by hiding only the representation of the object itself, not its subtree, instead "pulling up" everything below it one level in the hierarchical nesting.

Note again that this is a hint for UI only - it should not be interpreted by any renderer as making a prim invisible to drawing.

◆ IsValid()

bool IsValid ( ) const
inline

Return true if this is a valid object, false otherwise.

Definition at line 126 of file object.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Returns true if this object is valid, false otherwise.

Definition at line 139 of file object.h.

◆ SetAssetInfo()

USD_API void SetAssetInfo ( const VtDictionary customData) const

Author this object's assetInfo dictionary to assetInfo at the current EditTarget.

◆ SetAssetInfoByKey()

USD_API void SetAssetInfoByKey ( const TfToken keyPath,
const VtValue value 
) const

Author the element identified by keyPath in this object's assetInfo dictionary at the current EditTarget.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ SetCustomData()

USD_API void SetCustomData ( const VtDictionary customData) const

Author this object's customData dictionary to customData at the current EditTarget.

◆ SetCustomDataByKey()

USD_API void SetCustomDataByKey ( const TfToken keyPath,
const VtValue value 
) const

Author the element identified by keyPath in this object's customData dictionary at the current EditTarget.

The keyPath is a ':'-separated path identifying a value in subdictionaries.

◆ SetDisplayName()

USD_API bool SetDisplayName ( const std::string &  name) const

Sets this object's display name (metadata).

Returns true on success.

DisplayName is meant to be a descriptive label, not necessarily an alternate identifier; therefore there is no restriction on which characters can appear in it.

◆ SetDocumentation()

USD_API bool SetDocumentation ( const std::string &  doc) const

Sets this object's documentation (metadata). Returns true on success.

◆ SetHidden()

USD_API bool SetHidden ( bool  hidden) const

Sets the value of the 'hidden' metadata field.

See IsHidden() for details.

◆ SetMetadata() [1/2]

bool SetMetadata ( const TfToken key,
const T &  value 
) const
inline

Set metadatum key's value to value.

Returns
false if value's type does not match the schema type for key.
See also
General Metadata in USD

Definition at line 747 of file object.h.

◆ SetMetadata() [2/2]

USD_API bool SetMetadata ( const TfToken key,
const VtValue value 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ SetMetadataByDictKey() [1/2]

bool SetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
const T &  value 
) const
inline

Author value to the field identified by key and keyPath at the current EditTarget.

The keyPath is a ':'-separated path identifying a value in subdictionaries stored in the metadata field at key. Return true if the value is authored successfully, false otherwise.

See also
Dictionary-valued Metadata

Definition at line 765 of file object.h.

◆ SetMetadataByDictKey() [2/2]

USD_API bool SetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
const VtValue value 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const UsdObject obj)
friend

Definition at line 168 of file object.h.

◆ operator!=

bool operator!= ( const UsdObject lhs,
const UsdObject rhs 
)
friend

Inequality comparison.

Return false if lhs and rhs represent the same UsdObject, true otherwise.

Definition at line 156 of file object.h.

◆ operator<

bool operator< ( const UsdObject lhs,
const UsdObject rhs 
)
friend

Less-than operator.

Returns true if lhs < rhs.

This simply compares the paths of the objects.

Definition at line 163 of file object.h.

◆ operator==

bool operator== ( const UsdObject lhs,
const UsdObject rhs 
)
friend

Equality comparison.

Return true if lhs and rhs represent the same UsdObject, false otherwise.

Definition at line 147 of file object.h.

◆ TfHashAppend

void TfHashAppend ( HashState &  h,
const UsdObject obj 
)
friend

Definition at line 174 of file object.h.

◆ UsdStage

friend class UsdStage
friend

Definition at line 723 of file object.h.


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