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