All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
object.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef USD_OBJECT_H
25 #define USD_OBJECT_H
26 
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/usd/api.h"
31 #include "pxr/usd/usd/common.h"
32 #include "pxr/usd/usd/primData.h"
33 
34 #include "pxr/usd/sdf/abstractData.h"
35 #include "pxr/usd/sdf/path.h"
36 
37 #include <type_traits>
38 
39 PXR_NAMESPACE_OPEN_SCOPE
40 
41 
43 
49 {
50  // Value order matters in this enum.
51  UsdTypeObject,
52  UsdTypePrim,
53  UsdTypeProperty,
54  UsdTypeAttribute,
55  UsdTypeRelationship,
56 
57  Usd_NumObjTypes
58 };
59 
60 
61 namespace _Detail {
62 
63 // A metafunction that takes a UsdObject class like UsdObject, UsdPrim,
64 // UsdProperty, etc, and gives its corresponding UsdObjType, e.g. UsdTypeObject,
65 // UsdTypePrim, UsdTypeProperty, etc. Usage: GetObjType<UsdPrim>::Value.
66 template <UsdObjType Type>
67 struct Const { static const UsdObjType Value = Type; };
68 template <class T> struct GetObjType {
69  static_assert(std::is_base_of<UsdObject, T>::value,
70  "Type T must be a subclass of UsdObject.");
71 };
72 template <> struct GetObjType<UsdObject> : Const<UsdTypeObject> {};
73 template <> struct GetObjType<UsdPrim> : Const<UsdTypePrim> {};
74 template <> struct GetObjType<UsdProperty> : Const<UsdTypeProperty> {};
75 template <> struct GetObjType<UsdAttribute> : Const<UsdTypeAttribute> {};
76 template <> struct GetObjType<UsdRelationship> : Const<UsdTypeRelationship> {};
77 
78 } // _Detail
79 
82 inline bool
83 UsdIsSubtype(UsdObjType baseType, UsdObjType subType) {
84  return (baseType == UsdTypeObject) || (baseType == subType) ||
85  (baseType == UsdTypeProperty && subType > UsdTypeProperty);
86 }
87 
90 inline bool
92  return UsdIsSubtype(to, from);
93 }
94 
97 inline bool
99  return type == UsdTypePrim ||
100  type == UsdTypeAttribute ||
101  type == UsdTypeRelationship;
102 }
103 
129 class UsdObject {
130 public:
132  UsdObject() : _type(UsdTypeObject) {}
133 
134  // --------------------------------------------------------------------- //
137  // --------------------------------------------------------------------- //
138 
140  bool IsValid() const {
141  if (!UsdIsConcrete(_type) || !_prim)
142  return false;
143  if (_type == UsdTypePrim)
144  return true;
145  SdfSpecType specType = _GetDefiningSpecType();
146  return (_type == UsdTypeAttribute &&
147  specType == SdfSpecTypeAttribute) ||
148  (_type == UsdTypeRelationship &&
149  specType == SdfSpecTypeRelationship);
150  }
151 
153  explicit operator bool() const {
154  return IsValid();
155  }
156 
157 public:
158 
161  friend bool operator==(const UsdObject &lhs, const UsdObject &rhs) {
162  return lhs._type == rhs._type &&
163  lhs._prim == rhs._prim &&
164  lhs._proxyPrimPath == rhs._proxyPrimPath &&
165  lhs._propName == rhs._propName;
166  }
167 
170  friend bool operator!=(const UsdObject &lhs, const UsdObject &rhs) {
171  return !(lhs == rhs);
172  }
173 
177  friend bool operator<(const UsdObject &lhs, const UsdObject &rhs) {
178  return lhs.GetPath() < rhs.GetPath();
179  }
180 
181  // hash_value overload for std/boost hash.
182  USD_API
183  friend size_t hash_value(const UsdObject &obj);
184 
187  USD_API
188  UsdStageWeakPtr GetStage() const;
189 
193  SdfPath GetPath() const {
194  // Allow getting expired object paths.
195  if (!_proxyPrimPath.IsEmpty()) {
196  return _type == UsdTypePrim ?
197  _proxyPrimPath : _proxyPrimPath.AppendProperty(_propName);
198  }
199  else if (Usd_PrimDataConstPtr p = get_pointer(_prim)) {
200  return _type == UsdTypePrim ?
201  p->GetPath() : p->GetPath().AppendProperty(_propName);
202  }
203  return SdfPath();
204  }
205 
208  const SdfPath &GetPrimPath() const {
209  // Allow getting expired object paths.
210  if (!_proxyPrimPath.IsEmpty()) {
211  return _proxyPrimPath;
212  }
213  else if (Usd_PrimDataConstPtr p = get_pointer(_prim)) {
214  return p->GetPath();
215  }
216  return SdfPath::EmptyPath();
217  }
218 
221  inline UsdPrim GetPrim() const;
222 
228  const TfToken &GetName() const {
229  return _type == UsdTypePrim ? GetPrimPath().GetNameToken() : _propName;
230  }
231 
235  template <class T>
236  T As() const {
237  // compile-time type assertion provided by invoking Is<T>().
238  return Is<T>() ? T(_type, _prim, _proxyPrimPath, _propName) : T();
239  }
240 
246  template <class T>
247  bool Is() const {
248  static_assert(std::is_base_of<UsdObject, T>::value,
249  "Provided type T must derive from or be UsdObject");
250  return UsdIsConvertible(_type, _Detail::GetObjType<T>::Value);
251  }
252 
258  USD_API
259  std::string GetDescription() const;
260 
261  // --------------------------------------------------------------------- //
263  // --------------------------------------------------------------------- //
264 
265 
266  // --------------------------------------------------------------------- //
269  // --------------------------------------------------------------------- //
270 
285  template<typename T>
286  bool GetMetadata(const TfToken& key, T* value) const;
290  USD_API
291  bool GetMetadata(const TfToken& key, VtValue* value) const;
292 
299  template<typename T>
300  bool SetMetadata(const TfToken& key, const T& value) const;
302  USD_API
303  bool SetMetadata(const TfToken& key, const VtValue& value) const;
304 
314  USD_API
315  bool ClearMetadata(const TfToken& key) const;
316 
320  USD_API
321  bool HasMetadata(const TfToken& key) const;
322 
326  USD_API
327  bool HasAuthoredMetadata(const TfToken& key) const;
328 
344  template <class T>
346  const TfToken& key, const TfToken &keyPath, T *value) const;
348  USD_API
350  const TfToken& key, const TfToken &keyPath, VtValue *value) const;
351 
359  template<typename T>
361  const TfToken& key, const TfToken &keyPath, const T& value) const;
363  USD_API
365  const TfToken& key, const TfToken &keyPath, const VtValue& value) const;
366 
374  USD_API
376  const TfToken& key, const TfToken& keyPath) const;
377 
384  USD_API
385  bool HasMetadataDictKey(
386  const TfToken& key, const TfToken &keyPath) const;
387 
394  USD_API
396  const TfToken& key, const TfToken &keyPath) const;
397 
404  USD_API
405  UsdMetadataValueMap GetAllMetadata() const;
406 
413  USD_API
414  UsdMetadataValueMap GetAllAuthoredMetadata() const;
415 
416  // --------------------------------------------------------------------- //
418  // --------------------------------------------------------------------- //
419 
420  // --------------------------------------------------------------------- //
423  // --------------------------------------------------------------------- //
424 
439  USD_API
440  bool IsHidden() const;
441 
444  USD_API
445  bool SetHidden(bool hidden) const;
446 
448  USD_API
449  bool ClearHidden() const;
450 
456  USD_API
457  bool HasAuthoredHidden() const;
458 
477  USD_API
478  VtDictionary GetCustomData() const;
479 
485  USD_API
486  VtValue GetCustomDataByKey(const TfToken &keyPath) const;
487 
490  USD_API
491  void SetCustomData(const VtDictionary &customData) const;
492 
496  USD_API
497  void SetCustomDataByKey(const TfToken &keyPath, const VtValue &value) const;
498 
502  USD_API
503  void ClearCustomData() const;
504 
509  USD_API
510  void ClearCustomDataByKey(const TfToken &keyPath) const;
511 
514  USD_API
515  bool HasCustomData() const;
516 
521  USD_API
522  bool HasCustomDataKey(const TfToken &keyPath) const;
523 
526  USD_API
527  bool HasAuthoredCustomData() const;
528 
533  USD_API
534  bool HasAuthoredCustomDataKey(const TfToken &keyPath) const;
535 
549  USD_API
550  VtDictionary GetAssetInfo() const;
551 
557  USD_API
558  VtValue GetAssetInfoByKey(const TfToken &keyPath) const;
559 
562  USD_API
563  void SetAssetInfo(const VtDictionary &customData) const;
564 
568  USD_API
569  void SetAssetInfoByKey(const TfToken &keyPath, const VtValue &value) const;
570 
574  USD_API
575  void ClearAssetInfo() const;
576 
581  USD_API
582  void ClearAssetInfoByKey(const TfToken &keyPath) const;
583 
586  USD_API
587  bool HasAssetInfo() const;
588 
593  USD_API
594  bool HasAssetInfoKey(const TfToken &keyPath) const;
595 
598  USD_API
599  bool HasAuthoredAssetInfo() const;
600 
605  USD_API
606  bool HasAuthoredAssetInfoKey(const TfToken &keyPath) const;
607 
611  USD_API
612  std::string GetDocumentation() const;
613 
615  USD_API
616  bool SetDocumentation(const std::string& doc) const;
617 
620  USD_API
621  bool ClearDocumentation() const;
622 
625  USD_API
626  bool HasAuthoredDocumentation() const;
627 
628  // --------------------------------------------------------------------- //
630  // --------------------------------------------------------------------- //
631 
632  // XXX: This method can and probably should move to UsdProperty
633  static char GetNamespaceDelimiter()
634  { return SdfPathTokens->namespaceDelimiter.GetText()[0]; }
635 
636 private:
637  template <class T>
638  bool _GetMetadataImpl(const TfToken& key,
639  T* value,
640  const TfToken &keyPath=TfToken()) const;
641 
642  // Templated implementation. Will be overridden for value types that need
643  // to be mapped across edit targets.
644  template <class T>
645  bool _SetMetadata(const TfToken& key,
646  const T& value,
647  const TfToken &keyPath=TfToken()) const;
648 
649  // Non templated _SetMetadata overrides for value types that need to be
650  // mapped across edit targets.
651  USD_API
652  bool _SetMetadata(const TfToken& key,
653  const SdfTimeCode& value,
654  const TfToken &keyPath=TfToken()) const;
655  USD_API
656  bool _SetMetadata(const TfToken& key,
657  const VtArray<SdfTimeCode>& value,
658  const TfToken &keyPath=TfToken()) const;
659  USD_API
660  bool _SetMetadata(const TfToken& key,
661  const SdfTimeSampleMap& value,
662  const TfToken &keyPath=TfToken()) const;
663  USD_API
664  bool _SetMetadata(const TfToken& key,
665  const VtDictionary& value,
666  const TfToken &keyPath=TfToken()) const;
667 
668  // Type erased VtValue implementation. Will map the value across edit
669  // targets if the held value type supports it.
670  USD_API
671  bool _SetMetadata(const TfToken& key,
672  const VtValue& value,
673  const TfToken &keyPath=TfToken()) const;
674 
675  // This explicitly does not map values across edit targets for the
676  // implementation of _SetMetadata for types that don't need to be mapped.
677  USD_API
678  bool _SetUnmappedMetadataImpl(const TfToken& key,
679  const SdfAbstractDataConstValue& value,
680  const TfToken &keyPath) const;
681 
682 protected:
683  // Private constructor for UsdPrim.
684  UsdObject(const Usd_PrimDataHandle &prim,
685  const SdfPath &proxyPrimPath)
686  : _type(UsdTypePrim)
687  , _prim(prim)
688  , _proxyPrimPath(proxyPrimPath)
689  {
690  TF_VERIFY(!_prim || _prim->GetPath() != _proxyPrimPath);
691  }
692 
693  // Private constructor for UsdAttribute/UsdRelationship.
694  UsdObject(UsdObjType objType,
695  const Usd_PrimDataHandle &prim,
696  const SdfPath &proxyPrimPath,
697  const TfToken &propName)
698  : _type(objType)
699  , _prim(prim)
700  , _proxyPrimPath(proxyPrimPath)
701  , _propName(propName)
702  {
703  TF_VERIFY(!_prim || _prim->GetPath() != _proxyPrimPath);
704  }
705 
706  // Return the stage this object belongs to.
707  UsdStage *_GetStage() const { return _prim->GetStage(); }
708 
709  // Return this object's defining spec type.
710  USD_API
711  SdfSpecType _GetDefiningSpecType() const;
712 
713  // Helper for subclasses: return held prim data.
714  const Usd_PrimDataHandle &_Prim() const { return _prim; }
715 
716  // Helper for subclasses: return held property name.
717  const TfToken &_PropName() const { return _propName; }
718 
719  // Helper for subclasses: return held proxy prim path.
720  const SdfPath &_ProxyPrimPath() const { return _proxyPrimPath; }
721 
722 private:
723  // Helper for the above helper, and also for GetDescription()
724  std::string _GetObjectDescription(const std::string &preface) const;
725 
726  friend class UsdStage;
727 
728  friend UsdObjType Usd_GetObjType(const UsdObject &obj) {
729  return obj._type;
730  }
731 
732  UsdObjType _type;
733  Usd_PrimDataHandle _prim;
734  SdfPath _proxyPrimPath;
735  TfToken _propName;
736 
737 };
738 
739 template<typename T>
740 inline
741 bool
742 UsdObject::GetMetadata(const TfToken& key, T* value) const
743 {
744  SdfAbstractDataTypedValue<T> result(value);
745  return _GetMetadataImpl<SdfAbstractDataValue>(key, &result);
746 }
747 
748 template<typename T>
749 inline
750 bool
751 UsdObject::SetMetadata(const TfToken& key, const T& value) const
752 {
753  return _SetMetadata(key, value);
754 }
755 
756 template <typename T>
757 inline
758 bool
760  const TfToken &keyPath,
761  T *value) const
762 {
763  SdfAbstractDataTypedValue<T> result(value);
764  return _GetMetadataImpl<SdfAbstractDataValue>(key, &result, keyPath);
765 }
766 
767 template <typename T>
768 inline
769 bool
771  const TfToken &keyPath,
772  const T& value) const
773 {
774  return _SetMetadata(key, value, keyPath);
775 }
776 
777 template <class T>
778 bool
779 UsdObject::_SetMetadata(const TfToken& key,
780  const T& value,
781  const TfToken &keyPath) const
782 {
783  // Default implementation for most types can just type erase the value and
784  // set the metadata as is. Value types that need to be mapped across edit
785  // targets will need to override this function to do the mapping.
787  return _SetUnmappedMetadataImpl(key, in, keyPath);
788 }
789 
790 PXR_NAMESPACE_CLOSE_SCOPE
791 
792 #endif //USD_OBJECT_H
USD_API UsdStageWeakPtr GetStage() const
Return the stage that owns the object, and to whose state and lifetime this object&#39;s validity is tied...
UsdObjType
Enum values to represent the various Usd object types.
Definition: object.h:48
SDF_API SdfPath AppendProperty(TfToken const &propName) const
Creates a path by appending an element for propName to this path.
USD_API void ClearAssetInfoByKey(const TfToken &keyPath) const
Clear the authored opinion identified by keyPath in this object&#39;s assetInfo dictionary at the current...
T As() const
Convert this UsdObject to another object type T if possible.
Definition: object.h:236
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:62
USD_API bool HasAuthoredDocumentation() const
Returns true if documentation was explicitly authored and GetMetadata() will return a meaningful valu...
USD_API VtDictionary GetAssetInfo() const
Return this object&#39;s composed assetInfo dictionary.
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 t...
bool IsValid() const
Return true if this is a valid object, false otherwise.
Definition: object.h:140
USD_API void SetAssetInfoByKey(const TfToken &keyPath, const VtValue &value) const
Author the element identified by keyPath in this object&#39;s assetInfo dictionary at the current EditTar...
USD_API bool SetHidden(bool hidden) const
Sets the value of the &#39;hidden&#39; metadata field.
A type-erased container for a const field value in an SdfAbstractData.
Definition: abstractData.h:472
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:514
bool UsdIsSubtype(UsdObjType baseType, UsdObjType subType)
Return true if subType is the same as or a subtype of baseType, false otherwise.
Definition: object.h:83
A map with string keys and VtValue values.
Definition: dictionary.h:61
USD_API void SetCustomDataByKey(const TfToken &keyPath, const VtValue &value) const
Author the element identified by keyPath in this object&#39;s customData dictionary at the current EditTa...
SdfPath GetPath() const
Return the complete scene path to this object on its UsdStage, which may (UsdPrim) or may not (all ot...
Definition: object.h:193
USD_API bool ClearMetadata(const TfToken &key) const
Clears the authored key&#39;s value at the current EditTarget, returning false on error.
USD_API bool HasCustomData() const
Return true if there are any authored or fallback opinions for this object&#39;s customData dictionary...
friend bool operator<(const UsdObject &lhs, const UsdObject &rhs)
Less-than operator.
Definition: object.h:177
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
Definition: stage.h:142
USD_API void ClearCustomDataByKey(const TfToken &keyPath) const
Clear the authored opinion identified by keyPath in this object&#39;s customData dictionary at the curren...
USD_API void SetAssetInfo(const VtDictionary &customData) const
Author this object&#39;s assetInfo dictionary to assetInfo at the current EditTarget. ...
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...
SdfSpecType
An enum that specifies the type of an object.
Definition: types.h:91
bool GetMetadata(const TfToken &key, T *value) const
Resolve the requested metadatum named key into value, returning true on success.
Definition: object.h:742
USD_API bool ClearHidden() const
Clears the opinion for &quot;Hidden&quot; at the current EditTarget.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
Definition: attribute.h:176
SDF_API const TfToken & GetNameToken() const
Returns the name of the prim, property or relational attribute identified by the path, as a token.
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 va...
Definition: object.h:759
USD_API void SetCustomData(const VtDictionary &customData) const
Author this object&#39;s customData dictionary to customData at the current EditTarget.
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 t...
bool UsdIsConcrete(UsdObjType type)
Return true if type is a concrete object type, namely one of Prim, Attribute, or Relationship.
Definition: object.h:98
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 VtValue GetAssetInfoByKey(const TfToken &keyPath) const
Return the element identified by keyPath in this object&#39;s composed assetInfo dictionary.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
bool SetMetadata(const TfToken &key, const T &value) const
Set metadatum key&#39;s value to value.
Definition: object.h:751
USD_API bool HasAuthoredHidden() const
Returns true if hidden was explicitly authored and GetMetadata() will return a meaningful value for H...
USD_API bool HasAuthoredAssetInfo() const
Return true if there are any authored opinions (excluding fallback) for this object&#39;s assetInfo dicti...
USD_API void ClearCustomData() const
Clear the authored opinion for this object&#39;s customData dictionary at the current EditTarget...
USD_API UsdMetadataValueMap GetAllMetadata() const
Resolve and return all metadata (including both authored and fallback values) on this object...
#define TF_VERIFY(cond, format,...)
Checks a condition and reports an error if it evaluates false.
Definition: diagnostic.h:289
Value type that represents a time code.
Definition: timeCode.h:44
USD_API VtValue GetCustomDataByKey(const TfToken &keyPath) const
Return the element identified by keyPath in this object&#39;s composed customData dictionary.
USD_API UsdMetadataValueMap GetAllAuthoredMetadata() const
Resolve and return all user-authored metadata on this object, sorted lexicographically.
UsdPrim GetPrim() const
Return this object if it is a prim, otherwise return this object&#39;s nearest owning prim...
Definition: prim.h:1644
USD_API bool HasAssetInfo() const
Return true if there are any authored or fallback opinions for this object&#39;s assetInfo dictionary...
bool Is() const
Return true if this object is convertible to T.
Definition: object.h:247
USD_API bool HasAuthoredCustomDataKey(const TfToken &keyPath) const
Return true if there are any authored opinions (excluding fallback) for the element identified by key...
Base class for Usd scenegraph objects, providing common API.
Definition: object.h:129
The fully-typed container for a field value in an SdfAbstractData.
Definition: abstractData.h:441
USD_API bool ClearDocumentation() const
Clears this object&#39;s documentation (metadata) in the current EditTarget (only).
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:193
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:287
USD_API std::string GetDocumentation() const
Return this object&#39;s documentation (metadata).
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:128
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 HasAuthoredAssetInfoKey(const TfToken &keyPath) const
Return true if there are any authored opinions (excluding fallback) for the element identified by key...
USD_API bool IsHidden() const
Gets the value of the &#39;hidden&#39; metadata field, false if not authored.
bool UsdIsConvertible(UsdObjType from, UsdObjType to)
Return true if from is convertible to to, false otherwise.
Definition: object.h:91
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 avail...
Base class for UsdAttribute and UsdRelationship scenegraph objects.
Definition: property.h:55
USD_API VtDictionary GetCustomData() const
Return this object&#39;s composed customData dictionary.
UsdObject()
Default constructor produces an invalid object.
Definition: object.h:132
USD_API void ClearAssetInfo() const
Clear the authored opinion for this object&#39;s assetInfo dictionary at the current EditTarget.
const TfToken & GetName() const
Return the full name of this object, i.e.
Definition: object.h:228
friend bool operator==(const UsdObject &lhs, const UsdObject &rhs)
Equality comparison.
Definition: object.h:161
friend bool operator!=(const UsdObject &lhs, const UsdObject &rhs)
Inequality comparison.
Definition: object.h:170
USD_API std::string GetDescription() const
Return a string that provides a brief summary description of the object.
USD_API bool HasAuthoredCustomData() const
Return true if there are any authored opinions (excluding fallback) for this object&#39;s customData dict...
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.
Definition: object.h:770
USD_API bool SetDocumentation(const std::string &doc) const
Sets this object&#39;s documentation (metadata). Returns true on success.
const SdfPath & GetPrimPath() const
Return this object&#39;s path if this object is a prim, otherwise this object&#39;s nearest owning prim&#39;s pat...
Definition: object.h:208
bool IsEmpty() const noexcept
Returns true if this is the empty path (SdfPath::EmptyPath()).
Definition: path.h:409
static SDF_API const SdfPath & EmptyPath()
The empty path value, equivalent to SdfPath().
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182
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. ...
std::map< double, VtValue > SdfTimeSampleMap
A map from sample times to sample values.
Definition: types.h:280