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