HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primDefinition.h
Go to the documentation of this file.
1 //
2 // Copyright 2020 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_USD_PRIM_DEFINITION_H
8 #define PXR_USD_USD_PRIM_DEFINITION_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/usd/usd/api.h"
13 
14 #include "pxr/usd/sdf/layer.h"
18 #include "pxr/base/tf/hash.h"
19 
20 #include <unordered_map>
21 
23 
24 class UsdPrim;
25 
26 /// Class representing the builtin definition of a prim given the schemas
27 /// registered in the schema registry. It provides access to the the builtin
28 /// properties and metadata of a prim whose type is defined by this definition.
29 ///
30 /// Instances of this class can only be created by the UsdSchemaRegistry.
32 {
33 public:
34  ~UsdPrimDefinition() = default;
35 
36  /// Return the list of names of builtin properties for this prim definition.
37  const TfTokenVector &GetPropertyNames() const { return _properties; }
38 
39  /// Return the list of names of the API schemas that have been applied to
40  /// this prim definition in order.
42  return _appliedAPISchemas;
43  }
44 
45 private:
46  // Forward declaration required by Property.
47  struct _LayerAndPath;
48 
49 public:
50  /// Accessor to a property's definition in the prim definition.
51  ///
52  /// These are returned by calls to UsdPrimDefinition::GetPropertyDefinition
53  /// and can be used check the existence of a property (via conversion to
54  /// bool) and get field values that a defined for a property in the prim
55  /// definition.
56  ///
57  /// This class is just a thin wrapper around the property representation in
58  /// the UsdPrimDefinition that creates it and cannot be stored or accessed
59  /// beyond the lifetime of the prim definition itself.
60  class Property {
61  public:
62  /// Default constructor returns an invalid property.
63  Property() = default;
64 
65  /// Returns the name of the requested property.
66  /// Note that the return value of GetName gives no indication as to
67  /// whether this is a valid property.
68  USD_API
69  const TfToken &GetName() const;
70 
71  /// Conversion to bool returns true if this represents a valid property
72  /// in the prim definition, and false otherwise.
73  explicit operator bool() const
74  {
75  return _layerAndPath;
76  }
77 
78  /// Return true if the property is a valid is a valid property in the
79  /// prim definition and is an attribute.
80  USD_API
81  bool IsAttribute() const;
82 
83  /// Return true if the property is a valid is a valid property in the
84  /// prim definition and is a relationship.
85  USD_API
86  bool IsRelationship() const;
87 
88  /// \name Field Access Methods
89  /// These methods help get values for fields defined on a property in
90  /// a prim definition.
91  ///
92  /// None of the data access methods check that the property is valid
93  /// before trying to access the property. I.e. they all assume the
94  /// property is already known to be valid when called.
95  ///
96  /// Client code is on the hook for verifying the validity of the
97  /// Property before calling any of these methods. The validity can
98  /// be determined by converting the Property to bool.
99  ///
100  /// @{
101 
102  /// Returns the spec type of this property in the prim definition.
103  USD_API
104  SdfSpecType GetSpecType() const;
105 
106  /// Returns the list of names of metadata fields that are defined for
107  /// this property in the prim definition.
108  USD_API
110 
111  /// Retrieves the fallback value for the metadata field named \p key,
112  /// that is defined for this property in the prim definition, and stores
113  /// it in \p value if possible.
114  ///
115  /// Returns true if a value is defined for the given metadata \p key for
116  /// this property. Returns false otherwise.
117  template <class T>
118  bool GetMetadata(const TfToken &key, T* value) const;
119 
120  /// Retrieves the value at \p keyPath from the dictionary value for the
121  /// dictionary metadata field named \p key, that is defined for this
122  /// property in the prim definition, and stores it in \p value if
123  /// possible.
124  ///
125  /// Returns true if a dictionary value is defined for the given metadata
126  /// \p key for this property and it contains a value at \p keyPath.
127  /// Returns false otherwise.
128  template <class T>
130  const TfToken &key, const TfToken &keyPath, T* value) const;
131 
132  /// Returns the variability of this property in the prim definition.
133  USD_API
135 
136  /// Returns the documentation metadata defined by the prim definition
137  /// for this property.
138  USD_API
139  std::string GetDocumentation() const;
140 
141  /// @}
142 
143  protected:
144  // Only the prim definition can create real property accessors.
145  friend class UsdPrimDefinition;
146  Property(const TfToken &name, const _LayerAndPath *layerAndPath):
147  _name(name), _layerAndPath(layerAndPath) {}
148  Property(const _LayerAndPath *layerAndPath):
149  _layerAndPath(layerAndPath) {}
150 
152  const _LayerAndPath *_layerAndPath = nullptr;
153  };
154 
155  /// Accessor to a attribute's definition in the prim definition.
156  ///
157  /// These are returned by calls to UsdPrimDefinition::GetAttributeDefinition
158  /// and can be freely converted to from a Property accessor. These can be
159  /// used to check that a property exists and is an attribute (via conversion
160  /// to bool) and to get attribute relevant field values that are defined for
161  /// a property in the prim definition.
162  ///
163  /// This class is just a thin wrapper around the property representation in
164  /// the UsdPrimDefinition that creates it and cannot be stored or accessed
165  /// beyond the lifetime of the prim definition itself.
166  class Attribute : public Property {
167  public:
168  /// Default constructor returns an invalid attribute.
169  Attribute() = default;
170 
171  /// Copy constructor from a Property to allow implicit conversion.
172  USD_API
173  Attribute(const Property &property);
174 
175  /// Move constructor from a Property to allow implicit conversion.
176  USD_API
177  Attribute(Property &&property);
178 
179  /// Conversion to bool returns true if this represents a valid property
180  /// in the prim definition that is an attribute, and false otherwise.
181  explicit operator bool() const {
182  return IsAttribute();
183  }
184 
185  /// \name Field Access Methods
186  /// These methods help get values for additional fields defined on a
187  /// attribute in a prim definition.
188  ///
189  /// None of the data access methods check that the attribute is valid
190  /// before trying to access the attribute. I.e. they all assume the
191  /// attribute is already known to be valid when called.
192  ///
193  /// Client code is on the hook for verifying the validity of the
194  /// Attribute before calling any of these methods. The validity can
195  /// be determined by converting the Attribute to bool.
196  ///
197  /// @{
198 
199  /// Returns the value type name of this attribute in the prim
200  /// definition.
201  USD_API
203 
204  /// Returns the token value of the type name of this attribute in the
205  /// prim definition.
206  USD_API
207  TfToken GetTypeNameToken() const;
208 
209  /// Retrieves the fallback value of type \p T for this attribute and
210  /// stores it in \p value if possible.
211  ///
212  /// Returns true if this attribute has a fallback value defined with
213  /// the expected type. Returns false otherwise.
214  template <class T>
215  bool GetFallbackValue(T *value) const;
216 
217  /// @}
218  };
219 
220  /// Accessor to a relationship's definition in the prim definition.
221  ///
222  /// These are returned by calls to
223  /// UsdPrimDefinition::GetRelationshipDefinition and can be freely converted
224  /// to from a Property accessor. These can be used to check that a property
225  /// exists and is a relationship (via conversion to bool) and to get
226  /// relationship relevant field values that are defined for a property in
227  /// the prim definition.
228  ///
229  /// This class is just a thin wrapper around the property representation in
230  /// the UsdPrimDefinition that creates it and cannot be stored or accessed
231  /// beyond the lifetime of the prim definition itself.
232  class Relationship : public Property {
233  public:
234  /// Default constructor returns an invalid relationship.
235  Relationship() = default;
236 
237  /// Copy constructor from a Property to allow implicit conversion.
238  USD_API
239  Relationship(const Property &property);
240 
241  /// Move constructor from a Property to allow implicit conversion.
242  USD_API
243  Relationship(Property &&property);
244 
245  /// Conversion to bool returns true if this represents a valid property
246  /// in the prim definition that is a relationship, and false otherwise.
247  explicit operator bool() const{
248  return IsRelationship();
249  }
250  };
251 
252  /// Returns a property accessor the property named \p propName if it is
253  /// defined by this this prim definition. If a property with the given name
254  /// doesn't exist, this will return an invalid Property.
255  USD_API
256  Property GetPropertyDefinition(const TfToken& propName) const;
257 
258  /// Returns an attribute accessor the property named \p attrName if it is
259  /// defined by this this prim definition and is an attribute. If a property
260  /// with the given name doesn't exist or exists but isn't an attribute,
261  /// this will return an invalid Attribute.
262  USD_API
263  Attribute GetAttributeDefinition(const TfToken& attrName) const;
264 
265  /// Returns a relationship accessor the property named \p relName if it is
266  /// defined by this this prim definition and is a relationship. If a
267  /// property with the given name doesn't exist or exists but isn't a
268  /// relationship, this will return an invalid Relationship.
269  USD_API
270  Relationship GetRelationshipDefinition(const TfToken& relName) const;
271 
272  /// Return the SdfSpecType for \p propName if it is a builtin property of
273  /// the prim type represented by this prim definition. Otherwise return
274  /// SdfSpecTypeUnknown.
275  USD_API
276  SdfSpecType GetSpecType(const TfToken &propName) const;
277 
278  /// \deprecated Use GetPropertyDefinition instead.
279  ///
280  /// Return the property spec that defines the fallback for the property
281  /// named \a propName on prims of this prim definition's type. Return null
282  /// if there is no such property spec.
283  USD_API
284  SdfPropertySpecHandle GetSchemaPropertySpec(
285  const TfToken& propName) const;
286 
287  /// \deprecated Use GetAttributeDefinition instead.
288  ///
289  /// This is a convenience method. It is shorthand for
290  /// TfDynamic_cast<SdfAttributeSpecHandle>(
291  /// GetSchemaPropertySpec(primType, attrName));
292  USD_API
293  SdfAttributeSpecHandle GetSchemaAttributeSpec(
294  const TfToken& attrName) const;
295 
296  /// \deprecated Use GetRelationshipDefinition instead.
297  ///
298  /// This is a convenience method. It is shorthand for
299  /// TfDynamic_cast<SdfRelationshipSpecHandle>(
300  /// GetSchemaPropertySpec(primType, relName));
301  USD_API
302  SdfRelationshipSpecHandle GetSchemaRelationshipSpec(
303  const TfToken& relName) const;
304 
305  /// Retrieves the fallback value for the attribute named \p attrName and
306  /// stores it in \p value if possible.
307  ///
308  /// Returns true if the attribute exists in this prim definition and it has
309  /// a fallback value defined. Returns false otherwise.
310  template <class T>
311  bool GetAttributeFallbackValue(const TfToken &attrName, T *value) const
312  {
313  return _HasField(attrName, SdfFieldKeys->Default, value);
314  }
315 
316  /// Returns the list of names of metadata fields that are defined by this
317  /// prim definition for the prim itself.
318  USD_API
320 
321  /// Retrieves the fallback value for the metadata field named \p key, that
322  /// is defined by this prim definition for the prim itself and stores it in
323  /// \p value if possible.
324  ///
325  /// Returns true if a fallback value is defined for the given metadata
326  /// \p key. Returns false otherwise.
327  template <class T>
328  bool GetMetadata(const TfToken &key, T* value) const
329  {
331  return false;
332  }
333  return _HasField(TfToken(), key, value);
334  }
335 
336  /// Retrieves the value at \p keyPath from the fallback dictionary value
337  /// for the dictionary metadata field named \p key, that is defined by this
338  /// prim definition for the prim itself, and stores it in \p value if
339  /// possible.
340  ///
341  /// Returns true if a fallback dictionary value is defined for the given
342  /// metadata \p key and it contains a value at \p keyPath. Returns false
343  /// otherwise.
344  template <class T>
345  bool GetMetadataByDictKey(const TfToken &key,
346  const TfToken &keyPath, T* value) const
347  {
349  return false;
350  }
351  return _HasFieldDictKey(TfToken(), key, keyPath, value);
352  }
353 
354  /// Returns the documentation metadata defined by the prim definition for
355  /// the prim itself.
356  USD_API
357  std::string GetDocumentation() const;
358 
359  /// Returns the list of names of metadata fields that are defined by this
360  /// prim definition for property \p propName if a property named \p propName
361  /// exists.
362  USD_API
363  TfTokenVector ListPropertyMetadataFields(const TfToken &propName) const;
364 
365  /// Retrieves the fallback value for the metadata field named \p key, that
366  /// is defined by this prim definition for the property named \p propName,
367  /// and stores it in \p value if possible.
368  ///
369  /// Returns true if a fallback value is defined for the given metadata
370  /// \p key for the named property. Returns false otherwise.
371  template <class T>
373  const TfToken &propName, const TfToken &key, T* value) const
374  {
375  if (Property prop = GetPropertyDefinition(propName)) {
376  return prop.GetMetadata(key, value);
377  }
378  return false;
379  }
380 
381  /// Retrieves the value at \p keyPath from the fallback dictionary value
382  /// for the dictionary metadata field named \p key, that is defined by this
383  /// prim definition for the property named \p propName, and stores it in
384  /// \p value if possible.
385  ///
386  /// Returns true if a fallback dictionary value is defined for the given
387  /// metadata \p key for the named property and it contains a value at
388  /// \p keyPath. Returns false otherwise.
389  template <class T>
391  const TfToken &propName, const TfToken &key,
392  const TfToken &keyPath, T* value) const
393  {
394  if (Property prop = GetPropertyDefinition(propName)) {
395  return prop.GetMetadataByDictKey(key, keyPath, value);
396  }
397  return false;
398  }
399 
400  /// Returns the documentation metadata defined by the prim definition for
401  /// the property named \p propName if it exists.
402  USD_API
403  std::string GetPropertyDocumentation(const TfToken &propName) const;
404 
405  /// Copies the contents of this prim definition to a prim spec on the
406  /// given \p layer at the given \p path. This includes the entire property
407  /// spec for each of this definition's built-in properties as well as all of
408  /// this definition's prim metadata.
409  ///
410  /// If the prim definition represents a concrete prim type, the type name
411  /// of the prim spec is set to the the type name of this prim definition.
412  /// Otherwise the type name is set to empty. The 'apiSchemas' metadata
413  /// on the prim spec will always be explicitly set to the combined list
414  /// of all API schemas applied to this prim definition, i.e. the list
415  /// returned by UsdPrimDefinition::GetAppliedAPISchemas. Note that if this
416  /// prim definition is an API schema prim definition
417  /// (see UsdSchemaRegistry::FindAppliedAPIPrimDefinition) then 'apiSchemas'
418  /// will be empty as this prim definition does not "have" an applied API
419  /// because instead it "is" an applied API.
420  ///
421  /// If there is no prim spec at the given \p path, a new prim spec is
422  /// created at that path with the specifier \p newSpecSpecifier. Any
423  /// necessary ancestor specs will be created as well but they will always
424  /// be created as overs. If a spec does exist at \p path, then all of its
425  /// properties and
426  /// \ref UsdSchemaRegistry::IsDisallowedField "schema allowed metadata" are
427  /// cleared before it is populated from the prim definition.
428  USD_API
429  bool FlattenTo(const SdfLayerHandle &layer,
430  const SdfPath &path,
431  SdfSpecifier newSpecSpecifier = SdfSpecifierOver) const;
432 
433  /// \overload
434  /// Copies the contents of this prim definition to a prim spec at the
435  /// current edit target for a prim with the given \p name under the prim
436  /// \p parent.
437  USD_API
438  UsdPrim FlattenTo(const UsdPrim &parent,
439  const TfToken &name,
440  SdfSpecifier newSpecSpecifier = SdfSpecifierOver) const;
441 
442  /// \overload
443  /// Copies the contents of this prim definition to a prim spec at the
444  /// current edit target for the given \p prim.
445  USD_API
446  UsdPrim FlattenTo(const UsdPrim &prim,
447  SdfSpecifier newSpecSpecifier = SdfSpecifierOver) const;
448 
449 private:
450  // Only the UsdSchemaRegistry can construct prim definitions.
451  friend class UsdSchemaRegistry;
452 
453  // Friended private accessor for use by UsdStage when composing metadata
454  // values for value resolution. The public GetMetadata functions perform
455  // the extra step of filtering out disallowed or private metadata fields
456  // from the SdfSpecs before retrieving metadata. Value resolution does not
457  // want to pay that extra cost so uses this function instead.
458  template <class T>
459  friend bool Usd_GetFallbackValue(const UsdPrimDefinition &primDef,
460  const TfToken &propName,
461  const TfToken &fieldName,
462  const TfToken &keyPath,
463  T *value)
464  {
465  // Try to read fallback value.
466  return keyPath.IsEmpty() ?
467  primDef._HasField(propName, fieldName, value) :
468  primDef._HasFieldDictKey(propName, fieldName, keyPath, value);
469  }
470 
471  // Prim definitions store property access via a pointer to the schematics
472  // layer and a path to the property spec on that layer.
473  struct _LayerAndPath {
474  // Note that we use a raw pointer to the layer (for efficiency) as only
475  // the schema registry can create a UsdPrimDefinition and is responsible
476  // for making sure any schematics layers are alive throughout the
477  // life-time of any UsdPrimDefinition it creates.
478  const SdfLayer *layer = nullptr;
479  SdfPath path;
480 
481  // Accessors for the common data we extract from the schematics, inline
482  // for efficiency during value resolution
483  template <class T>
484  bool HasField(const TfToken& fieldName, T* value) const {
485  return layer->HasField(path, fieldName, value);
486  }
487 
488  template <class T>
489  bool HasFieldDictKey(
490  const TfToken& fieldName, const TfToken& keyPath, T* value) const {
491  return layer->HasFieldDictKey(path, fieldName, keyPath, value);
492  }
493 
494  explicit operator bool() const noexcept {
495  return layer;
496  }
497  };
498 
499  /// It is preferable to use the _HasField and _HasFieldDictKey methods to
500  /// access property field values, as opposed to getting a spec handle from
501  /// the GetSchemaXXXSpec functions, as these methods are faster.
502  template <class T>
503  bool _HasField(const TfToken& propName,
504  const TfToken& fieldName,
505  T* value) const
506  {
507  if (const _LayerAndPath *layerAndPath =
508  _GetPropertyLayerAndPath(propName)) {
509  return layerAndPath->HasField(fieldName, value);
510  }
511  return false;
512  }
513 
514  template <class T>
515  bool _HasFieldDictKey(const TfToken& propName,
516  const TfToken& fieldName,
517  const TfToken& keyPath,
518  T* value) const
519  {
520  if (const _LayerAndPath *layerAndPath =
521  _GetPropertyLayerAndPath(propName)) {
522  return layerAndPath->HasFieldDictKey(fieldName, keyPath, value);
523  }
524  return false;
525  }
526 
527  UsdPrimDefinition() = default;
528  UsdPrimDefinition(const UsdPrimDefinition &) = default;
529 
530  USD_API
531  void _IntializeForTypedSchema(
532  const SdfLayerHandle &schematicsLayer,
533  const SdfPath &schematicsPrimPath,
534  const VtTokenArray &propertiesToIgnore);
535 
536  USD_API
537  void _IntializeForAPISchema(
538  const TfToken &apiSchemaName,
539  const SdfLayerHandle &schematicsLayer,
540  const SdfPath &schematicsPrimPath,
541  const VtTokenArray &propertiesToIgnore);
542 
543  // Only used by the two _Initialize methods.
544  bool _MapSchematicsPropertyPaths(
545  const VtTokenArray &propertiesToIgnore);
546 
547  // Accessors for looking property spec paths by name.
548  const _LayerAndPath *_GetPropertyLayerAndPath(const TfToken& propName) const
549  {
550  return TfMapLookupPtr(_propLayerAndPathMap, propName);
551  }
552 
553  _LayerAndPath *_GetPropertyLayerAndPath(const TfToken& propName)
554  {
555  return TfMapLookupPtr(_propLayerAndPathMap, propName);
556  }
557 
558  // Helpers for constructing the prim definition.
559  void _ComposePropertiesFromPrimDef(
560  const UsdPrimDefinition &weakerPrimDef);
561 
562  void _ComposePropertiesFromPrimDefInstance(
563  const UsdPrimDefinition &weakerPrimDef,
564  const std::string &instanceName);
565 
566  void _AddOrComposeProperty(
567  const TfToken &propName,
568  const _LayerAndPath &layerAndPath);
569 
570  SdfSpecHandle _FindOrCreateSpecForComposition(
571  const TfToken &propName,
572  const _LayerAndPath &srcLayerAndPath);
573 
574  SdfSpecHandle _CreateComposedPrimOrPropertyIfNeeded(
575  const TfToken &propName,
576  const _LayerAndPath &strongProp,
577  const _LayerAndPath &weakProp);
578 
579  USD_API
580  void _ComposeOverAndReplaceExistingProperty(
581  const TfToken &propName,
582  const SdfLayerRefPtr &overLayer,
583  const SdfPath &overPrimPath);
584 
585  using _FamilyAndInstanceToVersionMap =
586  std::unordered_map<std::pair<TfToken, TfToken>, UsdSchemaVersion, TfHash>;
587 
588  USD_API
589  bool _ComposeWeakerAPIPrimDefinition(
590  const UsdPrimDefinition &apiPrimDef,
591  const TfToken &instanceName,
592  _FamilyAndInstanceToVersionMap *alreadyAppliedSchemaFamilyVersions);
593 
594  static bool _PropertyTypesMatch(
595  const Property &strongProp,
596  const Property &weakProp);
597 
598  // Path to the prim in the schematics for this prim definition.
599  _LayerAndPath _primLayerAndPath;
600 
601  // Map for caching the paths to each property spec in the schematics by
602  // property name.
603  using _PrimTypePropNameToPathMap =
604  std::unordered_map<TfToken, _LayerAndPath, TfToken::HashFunctor>;
605  _PrimTypePropNameToPathMap _propLayerAndPathMap;
606  TfTokenVector _appliedAPISchemas;
607 
608  // Cached list of property names.
609  TfTokenVector _properties;
610 
611  // Layer that may be created for this prim definition if it's necessary to
612  // compose any new property specs for this definition from multiple
613  // property specs from other definitions.
614  SdfLayerRefPtr _composedPropertyLayer;
615 };
616 
617 template <class T>
618 bool
620 {
622  return false;
623  }
624  return _layerAndPath->HasField(key, value);
625 }
626 
627 template <class T>
628 bool
630  const TfToken &key, const TfToken &keyPath, T* value) const
631 {
633  return false;
634  }
635  return _layerAndPath->HasFieldDictKey(key, keyPath, value);
636 }
637 
638 template <class T>
639 bool
641 {
642  return _layerAndPath->HasField(SdfFieldKeys->Default, value);
643 }
644 
645 
647 
648 #endif //PXR_USD_USD_PRIM_DEFINITION_H
USD_API Attribute GetAttributeDefinition(const TfToken &attrName) const
Definition: layer.h:81
USD_API SdfAttributeSpecHandle GetSchemaAttributeSpec(const TfToken &attrName) const
USD_API TfTokenVector ListPropertyMetadataFields(const TfToken &propName) const
#define USD_API
Definition: api.h:23
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
USD_API Relationship GetRelationshipDefinition(const TfToken &relName) const
USD_API SdfValueTypeName GetTypeName() const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
USD_API const TfToken & GetName() const
USD_API SdfSpecType GetSpecType(const TfToken &propName) const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
USD_API SdfVariability GetVariability() const
Returns the variability of this property in the prim definition.
bool GetFallbackValue(T *value) const
~UsdPrimDefinition()=default
const TfTokenVector & GetAppliedAPISchemas() const
USD_API std::string GetDocumentation() const
USD_API bool IsAttribute() const
friend bool Usd_GetFallbackValue(const UsdPrimDefinition &primDef, const TfToken &propName, const TfToken &fieldName, const TfToken &keyPath, T *value)
USD_API TfTokenVector ListMetadataFields() const
bool GetPropertyMetadataByDictKey(const TfToken &propName, const TfToken &key, const TfToken &keyPath, T *value) const
OutGridT const XformOp bool bool
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
unsigned int UsdSchemaVersion
Schema versions are specified as a single unsigned integer value.
Property()=default
Default constructor returns an invalid property.
Definition: hash.h:472
USD_API Property GetPropertyDefinition(const TfToken &propName) const
bool GetPropertyMetadata(const TfToken &propName, const TfToken &key, T *value) const
Definition: token.h:70
Property(const _LayerAndPath *layerAndPath)
USD_API std::string GetPropertyDocumentation(const TfToken &propName) const
const _LayerAndPath * _layerAndPath
Container::mapped_type * TfMapLookupPtr(Container &map, Key const &key)
Definition: stl.h:124
USD_API std::string GetDocumentation() const
bool GetAttributeFallbackValue(const TfToken &attrName, T *value) const
Definition: prim.h:116
SdfSpecifier
Definition: types.h:100
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USD_API TfToken GetTypeNameToken() const
GLuint const GLchar * name
Definition: glcorearb.h:786
USD_API SdfSpecType GetSpecType() const
Returns the spec type of this property in the prim definition.
Definition: path.h:273
USD_API TfTokenVector ListMetadataFields() const
Relationship()=default
Default constructor returns an invalid relationship.
bool GetMetadataByDictKey(const TfToken &key, const TfToken &keyPath, T *value) const
SdfVariability
Definition: types.h:156
static USD_API bool IsDisallowedField(const TfToken &fieldName)
const TfTokenVector & GetPropertyNames() const
Return the list of names of builtin properties for this prim definition.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
SdfSpecType
Definition: types.h:68
Attribute()=default
Default constructor returns an invalid attribute.
USD_API SdfRelationshipSpecHandle GetSchemaRelationshipSpec(const TfToken &relName) const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool GetMetadata(const TfToken &key, T *value) const
Property(const TfToken &name, const _LayerAndPath *layerAndPath)
bool GetMetadata(const TfToken &key, T *value) const
USD_API bool FlattenTo(const SdfLayerHandle &layer, const SdfPath &path, SdfSpecifier newSpecSpecifier=SdfSpecifierOver) const
USD_API SdfPropertySpecHandle GetSchemaPropertySpec(const TfToken &propName) const
USD_API bool IsRelationship() const
bool IsEmpty() const
Returns true iff this token contains the empty string "".
Definition: token.h:288