HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
primSpec.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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_SDF_PRIM_SPEC_H
8 #define PXR_USD_SDF_PRIM_SPEC_H
9 
10 /// \file sdf/primSpec.h
11 
12 #include "pxr/pxr.h"
14 #include "pxr/usd/sdf/spec.h"
15 #include "pxr/usd/sdf/path.h"
16 #include "pxr/usd/sdf/payload.h"
17 #include "pxr/usd/sdf/proxyTypes.h"
18 #include "pxr/usd/sdf/types.h"
19 #include "pxr/usd/sdf/api.h"
21 
22 #include <iosfwd>
23 #include <map>
24 #include <string>
25 #include <vector>
26 
28 
29 /// \class SdfPrimSpec
30 ///
31 /// Represents a prim description in an SdfLayer object.
32 ///
33 /// Every SdfPrimSpec object is defined in a layer. It is identified by its
34 /// path (SdfPath class) in the namespace hierarchy of its layer. SdfPrimSpecs
35 /// can be created using the New() method as children of either the containing
36 /// SdfLayer itself (for "root level" prims), or as children of other
37 /// SdfPrimSpec objects to extend a hierarchy. The helper function
38 /// SdfCreatePrimInLayer() can be used to quickly create a hierarchy of
39 /// primSpecs.
40 ///
41 /// SdfPrimSpec objects have properties of two general types: attributes
42 /// (containing values) and relationships (different types of connections to
43 /// other prims and attributes). Attributes are represented by the
44 /// SdfAttributeSpec class and relationships by the SdfRelationshipSpec class.
45 /// Each prim has its own namespace of properties. Properties are stored and
46 /// accessed by their name.
47 ///
48 /// SdfPrimSpec objects have a typeName, permission restriction, and they
49 /// reference and inherit prim paths. Permission restrictions control which
50 /// other layers may refer to, or express opinions about a prim. See the
51 /// SdfPermission class for more information.
52 ///
53 /// \todo
54 /// \li Insert doc about references and inherits here.
55 /// \li Should have validate... methods for name, children, properties
56 ///
57 class SdfPrimSpec : public SdfSpec
58 {
59  SDF_DECLARE_SPEC(SdfPrimSpec, SdfSpec);
60 
61 public:
66 
67  ///
68  /// \name Spec creation
69  /// @{
70 
71  /// Create a root prim spec.
72  ///
73  /// Creates a prim spec with a \p name, \p specifier and \p typeName as a
74  /// root prim in the given layer.
75  SDF_API
76  static SdfPrimSpecHandle
77  New(const SdfLayerHandle& parentLayer,
78  const std::string& name, SdfSpecifier spec,
79  const std::string& typeName = std::string());
80 
81  /// Create a prim spec.
82  ///
83  /// Creates a prim spec with a \p name, \p specifier and \p typeName as
84  /// a namespace child of the given prim.
85  ///
86  /// \sa SdfCreatePrimInLayer() to create a PrimSpec with all required
87  /// ancestor specs as SdfSpecifierOver.
88  SDF_API
89  static SdfPrimSpecHandle
90  New(const SdfPrimSpecHandle& parentPrim,
91  const std::string& name, SdfSpecifier spec,
92  const std::string& typeName = std::string());
93 
94  /// \name Name
95  /// @{
96 
97  /// Returns the prim's name.
98  SDF_API
99  const std::string& GetName() const;
100 
101  /// Returns the prim's name, as a token.
102  SDF_API
103  TfToken GetNameToken() const;
104 
105  /// Returns true if setting the prim spec's name to \p newName will
106  /// succeed.
107  ///
108  /// Returns false if it won't, and sets \p whyNot with a string
109  /// describing why not.
110  SDF_API
111  bool CanSetName(const std::string& newName, std::string* whyNot) const;
112 
113  /// Sets the prim's name.
114  ///
115  /// Children prims must be unique by name. It is an error to
116  /// set the name to the same name as an existing child of this
117  /// prim's parent.
118  ///
119  /// Setting validate to false, will skip validation of the \p newName
120  /// (that is, CanSetName will not be called).
121  ///
122  /// Returns true if successful, false otherwise.
123  SDF_API
124  bool SetName(const std::string& newName, bool validate = true);
125 
126  /// Returns true if the given string is a valid prim name.
127  SDF_API
128  static bool IsValidName(const std::string& name);
129 
130  /// @}
131  /// \name Namespace hierarchy
132  /// @{
133 
134  /// Returns the prim's namespace pseudo-root prim.
135  SDF_API
136  SdfPrimSpecHandle GetNameRoot() const;
137 
138  /// Returns the prim's namespace parent.
139  ///
140  /// This does not return the pseudo-root for root prims. Most
141  /// algorithms that scan the namespace hierarchy upwards don't
142  /// want to process the pseudo-root the same way as actual prims.
143  /// Algorithms that do can always call \c GetRealNameParent().
144  SDF_API
145  SdfPrimSpecHandle GetNameParent() const;
146 
147  /// Returns the prim's namespace parent.
148  SDF_API
149  SdfPrimSpecHandle GetRealNameParent() const;
150 
151  /// Returns a keyed vector view of the prim's namespace children.
152  SDF_API
154 
155  /// Updates nameChildren to match the given vector of prims.
156  SDF_API
157  void SetNameChildren(const SdfPrimSpecHandleVector&);
158 
159  /// Inserts a child.
160  ///
161  /// \p index is ignored except for range checking; -1 is permitted.
162  ///
163  /// Returns true if successful, false if failed.
164  SDF_API
165  bool InsertNameChild(const SdfPrimSpecHandle& child, int index = -1);
166 
167  /// Removes the child. Returns true if successful, false if failed.
168  SDF_API
169  bool RemoveNameChild(const SdfPrimSpecHandle& child);
170 
171  /// Returns the list of child names for this prim's reorder.
172  /// nameChildren statement.
173  ///
174  /// See SetNameChildrenOrder() for more info.
175  SDF_API
177 
178  /// Returns true if this prim has name children order specified
179  SDF_API
180  bool HasNameChildrenOrder() const;
181 
182  /// Given a list of (possibly sparse) child names, authors a reorder
183  /// nameChildren statement for this prim.
184  ///
185  /// The reorder statement can modify the order of name children
186  /// during composition. This order doesn't affect GetNameChildren(),
187  /// InsertNameChild(), SetNameChildren(), et al.
188  SDF_API
189  void SetNameChildrenOrder(const std::vector<TfToken>& names);
190 
191  /// Adds a new name child \p name in the name children order.
192  /// If \p index is -1, the name is inserted at the end.
193  SDF_API
194  void InsertInNameChildrenOrder(const TfToken& name, int index = -1);
195 
196  /// Removes a name child name from the name children order.
197  SDF_API
198  void RemoveFromNameChildrenOrder(const TfToken& name);
199 
200  /// Removes a name child name from the name children order by index.
201  SDF_API
203 
204  /// Reorders the given list of child names according to the reorder
205  /// nameChildren statement for this prim.
206  ///
207  /// This routine employs the standard list editing operation for ordered
208  /// items in a ListEditor.
209  SDF_API
210  void ApplyNameChildrenOrder(std::vector<TfToken>* vec) const;
211 
212  /// @}
213  /// \name Properties
214  /// @{
215 
216  /// Returns the prim's properties.
217  SDF_API
219 
220  /// Updates properties to match the given vector of properties.
221  SDF_API
222  void SetProperties(const SdfPropertySpecHandleVector&);
223 
224  /// Inserts a property.
225  ///
226  /// \p index is ignored except for range checking; -1 is permitted.
227  ///
228  /// Returns true if successful, false if failed.
229  SDF_API
230  bool InsertProperty(const SdfPropertySpecHandle& property, int index = -1);
231 
232  /// Removes the property.
233  SDF_API
234  void RemoveProperty(const SdfPropertySpecHandle& property);
235 
236  /// Returns a view of the attributes of this prim.
237  SDF_API
239 
240  /// Returns a view of the relationships of this prim.
241  SDF_API
243 
244  /// Returns the list of property names for this prim's reorder
245  /// properties statement.
246  ///
247  /// See SetPropertyOrder() for more info.
248  SDF_API
250 
251  /// Returns true if this prim has a property ordering specified.
252  SDF_API
253  bool HasPropertyOrder() const;
254 
255  /// Given a list of (possibly sparse) property names, authors a
256  /// reorder properties statement for this prim.
257  ///
258  /// The reorder statement can modify the order of properties during
259  /// composition. This order doesn't affect GetProperties(),
260  /// InsertProperty(), SetProperties(), et al.
261  SDF_API
262  void SetPropertyOrder(const std::vector<TfToken>& names);
263 
264  /// Add a new property \p name in the property order.
265  /// If \p index is -1, the name is inserted at the end.
266  SDF_API
267  void InsertInPropertyOrder(const TfToken& name, int index = -1);
268 
269  /// Remove a property name from the property order.
270  SDF_API
271  void RemoveFromPropertyOrder(const TfToken& name);
272 
273  /// Remove a property name from the property order by index.
274  SDF_API
276 
277  /// Reorders the given list of property names according to the
278  /// reorder properties statement for this prim.
279  ///
280  /// This routine employs the standard list editing operation for ordered
281  /// items in a ListEditor.
282  SDF_API
283  void ApplyPropertyOrder(std::vector<TfToken>* vec) const;
284 
285  /// @}
286  /// \name Lookup
287  /// @{
288 
289  /// Returns the object for the given \p path.
290  ///
291  /// If \p path is relative then it will be interpreted as
292  /// relative to this prim. If it is absolute then it will be
293  /// interpreted as absolute in this prim's layer.
294  ///
295  /// Returns invalid handle if there is no object at \p path.
296  SDF_API
297  SdfSpecHandle GetObjectAtPath(const SdfPath& path) const;
298 
299  /// Returns a prim given its \p path.
300  ///
301  /// Returns invalid handle if there is no prim at \p path.
302  /// This is simply a more specifically typed version of GetObjectAtPath.
303  SDF_API
304  SdfPrimSpecHandle GetPrimAtPath(const SdfPath& path) const;
305 
306  /// Returns a property given its \p path.
307  ///
308  /// Returns invalid handle if there is no property at \p path.
309  /// This is simply a more specifically typed version of GetObjectAtPath.
310  SDF_API
311  SdfPropertySpecHandle GetPropertyAtPath(const SdfPath& path) const;
312 
313  /// Returns an attribute given its \p path.
314  ///
315  /// Returns invalid handle if there is no attribute at \p path.
316  /// This is simply a more specifically typed version of GetObjectAtPath.
317  SDF_API
318  SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath& path) const;
319 
320  /// Returns a relationship given its \p path.
321  ///
322  /// Returns invalid handle if there is no relationship at \p path.
323  /// This is simply a more specifically typed version of GetObjectAtPath.
324  SDF_API
325  SdfRelationshipSpecHandle GetRelationshipAtPath(const SdfPath& path) const;
326 
327  /// @}
328  /// \name Metadata
329  /// @{
330 
331  /// Returns the typeName of the prim.
332  ///
333  /// The typeName should be meaningful to a higher level
334  /// prim definition system.
335  ///
336  /// The default value for typeName is the empty token.
337  SDF_API
338  TfToken GetTypeName() const;
339 
340  /// Sets the typeName of the model prim.
341  SDF_API
342  void SetTypeName(const std::string& value);
343 
344  /// Returns the comment string for this prim spec.
345  ///
346  /// The default value for comment is @"".
347  SDF_API
348  std::string GetComment() const;
349 
350  /// Sets the comment string for this prim spec.
351  SDF_API
352  void SetComment(const std::string& value);
353 
354  /// Returns the documentation string for this prim spec.
355  ///
356  /// The default value for documentation is @"".
357  SDF_API
358  std::string GetDocumentation() const;
359 
360  /// Sets the documentation string for this prim spec.
361  SDF_API
362  void SetDocumentation(const std::string& value);
363 
364  /// Returns whether this prim spec is active.
365  ///
366  /// The default value for active is true.
367  SDF_API
368  bool GetActive() const;
369 
370  /// Sets whether this prim spec is active.
371  SDF_API
372  void SetActive(bool value);
373 
374  /// Returns true if this prim spec has an opinion about active.
375  SDF_API
376  bool HasActive() const;
377 
378  /// Removes the active opinion in this prim spec if there is one.
379  SDF_API
380  void ClearActive();
381 
382  /// Returns whether this prim spec will be hidden in browsers.
383  ///
384  /// The default value for hidden is false.
385  SDF_API
386  bool GetHidden() const;
387 
388  /// Sets whether this prim spec will be hidden in browsers.
389  SDF_API
390  void SetHidden( bool value );
391 
392  /// Returns this prim spec's kind.
393  ///
394  /// The default value for kind is an empty \c TfToken.
395  SDF_API
396  TfToken GetKind() const;
397 
398  /// Sets this prim spec's kind.
399  SDF_API
400  void SetKind(const TfToken& value);
401 
402  /// Returns true if this prim spec has an opinion about kind.
403  SDF_API
404  bool HasKind() const;
405 
406  /// Remove the kind opinion from this prim spec if there is one.
407  SDF_API
408  void ClearKind();
409 
410  /// Returns the symmetry function for this prim.
411  ///
412  /// The default value for symmetry function is an empty token.
413  SDF_API
415 
416  /// Sets the symmetry function for this prim.
417  ///
418  /// If \p functionName is an empty token, then this removes any symmetry
419  /// function for the given prim.
420  SDF_API
421  void SetSymmetryFunction(const TfToken& functionName);
422 
423  /// Returns the symmetry arguments for this prim.
424  ///
425  /// The default value for symmetry arguments is an empty dictionary.
426  SDF_API
428 
429  /// Sets a symmetry argument for this prim.
430  ///
431  /// If \p value is empty, then this removes the setting
432  /// for the given symmetry argument \p name.
433  SDF_API
434  void SetSymmetryArgument(const std::string& name, const VtValue& value);
435 
436  /// Returns the symmetric peer for this prim.
437  ///
438  /// The default value for symmetric peer is an empty string.
439  SDF_API
440  std::string GetSymmetricPeer() const;
441 
442  /// Sets a symmetric peer for this prim.
443  ///
444  /// If \p peerName is empty, then this removes the symmetric peer
445  /// for this prim.
446  SDF_API
447  void SetSymmetricPeer(const std::string& peerName);
448 
449  /// Returns the prefix string for this prim spec.
450  ///
451  /// The default value for prefix is "".
452  SDF_API
453  std::string GetPrefix() const;
454 
455  /// Sets the prefix string for this prim spec.
456  SDF_API
457  void SetPrefix(const std::string& value);
458 
459  /// Returns the suffix string for this prim spec.
460  ///
461  /// The default value for suffix is "".
462  SDF_API
463  std::string GetSuffix() const;
464 
465  /// Sets the suffix string for this prim spec.
466  SDF_API
467  void SetSuffix(const std::string& value);
468 
469  /// Returns the custom data for this prim.
470  ///
471  /// The default value for custom data is an empty dictionary.
472  ///
473  /// Custom data is for use by plugins or other non-tools supplied
474  /// extensions that need to be able to store data attached to arbitrary
475  /// scene objects. Note that if the only objects you want to store data
476  /// on are prims, using custom attributes is probably a better choice.
477  /// But if you need to possibly store this data on attributes or
478  /// relationships or as annotations on reference arcs, then custom data
479  /// is an appropriate choice.
480  SDF_API
482 
483  /// Returns the asset info dictionary for this prim.
484  ///
485  /// The default value is an empty dictionary.
486  ///
487  /// The asset info dictionary is used to annotate prims representing the
488  /// root-prims of assets (generally organized as models) with various
489  /// data related to asset management. For example, asset name, root layer
490  /// identifier, asset version etc.
491  ///
492  SDF_API
494 
495  /// Sets a custom data entry for this prim.
496  ///
497  /// If \p value is empty, then this removes the given custom data entry.
498  SDF_API
499  void SetCustomData(const std::string& name, const VtValue& value);
500 
501  /// Sets a asset info entry for this prim.
502  ///
503  /// If \p value is empty, then this removes the given asset info entry.
504  ///
505  /// \sa GetAssetInfo()
506  ///
507  SDF_API
508  void SetAssetInfo(const std::string& name, const VtValue& value);
509 
510  /// Returns the spec specifier (def, over or class).
511  SDF_API
512  SdfSpecifier GetSpecifier() const;
513 
514  /// Sets the spec specifier (def or over).
515  SDF_API
517 
518  /// Returns the prim's permission restriction.
519  ///
520  /// The default value for permission is SdfPermissionPublic.
521  SDF_API
523 
524  /// Sets the prim's permission restriction.
525  SDF_API
527 
528  /// Returns the prefixSubstitutions dictionary for this prim spec.
529  ///
530  /// The default value for prefixSubstitutions is an empty VtDictionary.
531  SDF_API
533 
534  /// Sets the \p prefixSubstitutions dictionary for this prim spec.
535  SDF_API
536  void SetPrefixSubstitutions(const VtDictionary& prefixSubstitutions);
537 
538  /// Returns the suffixSubstitutions dictionary for this prim spec.
539  ///
540  /// The default value for suffixSubstitutions is an empty VtDictionary.
541  SDF_API
543 
544  /// Sets the \p suffixSubstitutions dictionary for this prim spec.
545  SDF_API
546  void SetSuffixSubstitutions(const VtDictionary& suffixSubstitutions);
547 
548  /// Sets the value for the prim's instanceable flag.
549  SDF_API
550  void SetInstanceable(bool instanceable);
551 
552  /// Returns the value for the prim's instanceable flag.
553  SDF_API
554  bool GetInstanceable() const;
555 
556  /// Returns true if this prim spec has a value authored for its
557  /// instanceable flag, false otherwise.
558  SDF_API
559  bool HasInstanceable() const;
560 
561  /// Clears the value for the prim's instanceable flag.
562  SDF_API
563  void ClearInstanceable();
564 
565  /// @}
566  /// \name Payloads
567  /// @{
568 
569  /// Returns a proxy for the prim's payloads.
570  ///
571  /// Payloads for this prim may be modified through the proxy.
572  SDF_API
574 
575  /// Returns true if this prim has payloads set.
576  SDF_API
577  bool HasPayloads() const;
578 
579  /// Clears the payloads for this prim.
580  SDF_API
581  void ClearPayloadList();
582 
583  /// @}
584  /// \name Inherits
585  /// @{
586 
587  /// Returns a proxy for the prim's inherit paths.
588  ///
589  /// Inherit paths for this prim may be modified through the proxy.
590  SDF_API
592 
593  /// Returns true if this prim has inherit paths set.
594  SDF_API
595  bool HasInheritPaths() const;
596 
597  /// Clears the inherit paths for this prim.
598  SDF_API
599  void ClearInheritPathList();
600 
601  /// @}
602  /// \name Specializes
603  /// @{
604 
605  /// Returns a proxy for the prim's specializes paths.
606  ///
607  /// Specializes for this prim may be modified through the proxy.
608  SDF_API
610 
611  /// Returns true if this prim has specializes set.
612  SDF_API
613  bool HasSpecializes() const;
614 
615  /// Clears the specializes for this prim.
616  SDF_API
617  void ClearSpecializesList();
618 
619  /// @}
620  /// \name References
621  /// @{
622 
623  /// Returns a proxy for the prim's references.
624  ///
625  /// References for this prim may be modified through the proxy.
626  SDF_API
628 
629  /// Returns true if this prim has references set.
630  SDF_API
631  bool HasReferences() const;
632 
633  /// Clears the references for this prim.
634  SDF_API
635  void ClearReferenceList();
636 
637  /// @}
638  /// \name Variants
639  /// @{
640 
641  /// Returns a proxy for the prim's variant sets.
642  ///
643  /// Variant sets for this prim may be modified through the proxy.
644  SDF_API
646 
647  /// Returns true if this prim has variant sets set.
648  SDF_API
649  bool HasVariantSetNames() const;
650 
651  /// Returns list of variant names for the given variant set.
652  SDF_API
653  std::vector<std::string> GetVariantNames(const std::string& name) const;
654 
655  /// Returns the variant sets.
656  ///
657  /// The result maps variant set names to variant sets. Variant sets
658  /// may be removed through the proxy.
659  SDF_API
661 
662  /// Removes the variant set with the given \a name.
663  ///
664  /// Note that the set's name should probably also be removed from
665  /// the variant set names list.
666  SDF_API
667  void RemoveVariantSet(const std::string& name);
668 
669  /// Returns an editable map whose keys are variant set names and
670  /// whose values are the variants selected for each set.
671  SDF_API
673 
674  /// Sets the variant selected for the given variant set.
675  /// If \p variantName is empty, then this removes the variant
676  /// selection opinion for the variant set \p variantSetName. To
677  /// explicitly set the variant selection to be empty, use
678  /// BlockVariantSelection instead.
679  SDF_API
680  void SetVariantSelection(const std::string& variantSetName,
681  const std::string& variantName);
682 
683  /// Blocks the variant selected for the given variant set by setting
684  /// the variant selection to empty.
685  SDF_API
686  void BlockVariantSelection(const std::string& variantSetName);
687 
688  /// @}
689  /// \name Relocates
690  /// @{
691 
692  /// Get an editing proxy for the map of namespace relocations
693  /// specified on this prim.
694  ///
695  /// The map of namespace relocation paths is editable in-place via
696  /// this editing proxy. Individual source-target pairs can be added,
697  /// removed, or altered using common map operations.
698  ///
699  /// The map is organized as target \c SdfPath indexed by source \c SdfPath.
700  /// Key and value paths are stored as absolute regardless of how they're
701  /// added.
702  SDF_API
704 
705  /// Set the entire map of namespace relocations specified on this prim.
706  /// Use the editing proxy for modifying single paths in the map.
707  SDF_API
708  void SetRelocates(const SdfRelocatesMap& newMap);
709 
710  /// Returns true if this prim has any relocates opinion, including
711  /// that there should be no relocates (i.e. an empty map). An empty
712  /// map (no relocates) does not mean the same thing as a missing map
713  /// (no opinion).
714  SDF_API
715  bool HasRelocates() const;
716 
717  /// Clears the relocates opinion for this prim.
718  SDF_API
719  void ClearRelocates();
720 
721  /// @}
722 
723 private:
724  // Returns true if this object is the pseudo-root.
725  bool _IsPseudoRoot() const;
726 
727  // Raises an error and returns false if this is the pseudo-root,
728  // otherwise returns true. We want to allow clients to be able
729  // to use pseudo-roots as any other prim in namespace editing
730  // operations as well as silently permit read accesses on fields
731  // pseudo-roots don't actually have in order to promote generic
732  // algorithm programming. Mutating methods on SdfPrimSpec use
733  // this function as write access validation.
734  bool _ValidateEdit(const TfToken& key) const;
735 
736 private:
737  static SdfPrimSpecHandle
738  _New(const SdfPrimSpecHandle &parentPrim,
739  const TfToken &name, SdfSpecifier spec,
740  const TfToken &typeName);
741 };
742 
743 /// Convenience function to create a prim at the given path, and any
744 /// necessary parent prims, in the given layer.
745 ///
746 /// If a prim already exists at the given path it will be returned
747 /// unmodified.
748 ///
749 /// The new specs are created with SdfSpecifierOver and an empty type.
750 /// primPath must be a valid prim path.
751 SDF_API
752 SdfPrimSpecHandle SdfCreatePrimInLayer(const SdfLayerHandle& layer,
753  const SdfPath& primPath);
754 
755 
756 /// Convenience function to create a prim at the given path, and any
757 /// necessary parent prims, in the given layer.
758 ///
759 /// If a prim already exists at the given path, do nothing and return true.
760 ///
761 /// Any newly created specs have SdfSpecifierOver and an empty type. primPath
762 /// must be a valid prim path. Return false and issue an error if we fail to
763 /// author the required scene description.
764 SDF_API
765 bool SdfJustCreatePrimInLayer(const SdfLayerHandle& layer,
766  const SdfPath& primPath);
767 
769 
770 #endif // PXR_USD_SDF_PRIM_SPEC_H
SDF_API std::string GetSuffix() const
SDF_API bool GetHidden() const
SDF_API bool SdfJustCreatePrimInLayer(const SdfLayerHandle &layer, const SdfPath &primPath)
SDF_API std::vector< std::string > GetVariantNames(const std::string &name) const
Returns list of variant names for the given variant set.
SdfRelationshipSpecView RelationshipSpecView
Definition: primSpec.h:65
SDF_API void RemoveFromNameChildrenOrder(const TfToken &name)
Removes a name child name from the name children order.
SDF_API SdfPrimSpecHandle GetNameRoot() const
Returns the prim's namespace pseudo-root prim.
SDF_API SdfPropertySpecHandle GetPropertyAtPath(const SdfPath &path) const
SDF_API bool HasReferences() const
Returns true if this prim has references set.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
Definition: types.h:267
SDF_API bool HasPropertyOrder() const
Returns true if this prim has a property ordering specified.
SDF_API SdfInheritsProxy GetInheritPathList() const
GLsizei const GLfloat * value
Definition: glcorearb.h:824
SDF_API void SetTypeName(const std::string &value)
Sets the typeName of the model prim.
SDF_API bool SetName(const std::string &newName, bool validate=true)
SDF_API void SetComment(const std::string &value)
Sets the comment string for this prim spec.
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
SDF_API bool HasSpecializes() const
Returns true if this prim has specializes set.
SDF_API void SetNameChildrenOrder(const std::vector< TfToken > &names)
SDF_API void SetSymmetryArgument(const std::string &name, const VtValue &value)
SDF_API void SetSuffix(const std::string &value)
Sets the suffix string for this prim spec.
SDF_API SdfDictionaryProxy GetSymmetryArguments() const
SDF_API void InsertInPropertyOrder(const TfToken &name, int index=-1)
Definition: spec.h:32
SDF_API SdfPropertyOrderProxy GetPropertyOrder() const
SDF_API void SetDocumentation(const std::string &value)
Sets the documentation string for this prim spec.
SDF_API std::string GetSymmetricPeer() const
SDF_API SdfPrimSpecHandle SdfCreatePrimInLayer(const SdfLayerHandle &layer, const SdfPath &primPath)
SDF_API SdfVariantSetsProxy GetVariantSets() const
SDF_API void ClearRelocates()
Clears the relocates opinion for this prim.
SDF_API bool InsertProperty(const SdfPropertySpecHandle &property, int index=-1)
SDF_API SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath &path) const
SDF_API bool HasRelocates() const
SDF_API void ClearReferenceList()
Clears the references for this prim.
SDF_API TfToken GetSymmetryFunction() const
SDF_API AttributeSpecView GetAttributes() const
Returns a view of the attributes of this prim.
SDF_API void SetActive(bool value)
Sets whether this prim spec is active.
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
SDF_API bool HasVariantSetNames() const
Returns true if this prim has variant sets set.
SDF_API void SetNameChildren(const SdfPrimSpecHandleVector &)
Updates nameChildren to match the given vector of prims.
SDF_API SdfSpecHandle GetObjectAtPath(const SdfPath &path) const
Definition: token.h:70
static SDF_API SdfPrimSpecHandle New(const SdfLayerHandle &parentLayer, const std::string &name, SdfSpecifier spec, const std::string &typeName=std::string())
SdfPrimSpecView NameChildrenView
Definition: primSpec.h:62
SDF_API bool RemoveNameChild(const SdfPrimSpecHandle &child)
Removes the child. Returns true if successful, false if failed.
SDF_API void BlockVariantSelection(const std::string &variantSetName)
SDF_API void ClearActive()
Removes the active opinion in this prim spec if there is one.
SDF_API NameChildrenView GetNameChildren() const
Returns a keyed vector view of the prim's namespace children.
SDF_API RelationshipSpecView GetRelationships() const
Returns a view of the relationships of this prim.
SDF_API SdfVariantSelectionProxy GetVariantSelections() const
SDF_API std::string GetComment() const
SDF_API TfToken GetKind() const
SDF_API PropertySpecView GetProperties() const
Returns the prim's properties.
SDF_API void SetVariantSelection(const std::string &variantSetName, const std::string &variantName)
SDF_API const std::string & GetName() const
Returns the prim's name.
SDF_API bool HasInstanceable() const
SDF_API SdfPermission GetPermission() const
SDF_API bool HasPayloads() const
Returns true if this prim has payloads set.
SDF_API void SetCustomData(const std::string &name, const VtValue &value)
SDF_API SdfPrimSpecHandle GetRealNameParent() const
Returns the prim's namespace parent.
SdfSpecifier
Definition: types.h:100
SDF_API void SetRelocates(const SdfRelocatesMap &newMap)
SDF_API SdfPrimSpecHandle GetPrimAtPath(const SdfPath &path) const
SDF_API void SetPrefix(const std::string &value)
Sets the prefix string for this prim spec.
SDF_API TfToken GetNameToken() const
Returns the prim's name, as a token.
SDF_API void SetKind(const TfToken &value)
Sets this prim spec's kind.
SDF_API void RemoveFromPropertyOrder(const TfToken &name)
Remove a property name from the property order.
GLuint const GLchar * name
Definition: glcorearb.h:786
SDF_API void SetProperties(const SdfPropertySpecHandleVector &)
Updates properties to match the given vector of properties.
Definition: path.h:273
SDF_API void ClearInstanceable()
Clears the value for the prim's instanceable flag.
SDF_API void SetPermission(SdfPermission value)
Sets the prim's permission restriction.
SDF_API VtDictionary GetSuffixSubstitutions() const
SDF_API void RemoveProperty(const SdfPropertySpecHandle &property)
Removes the property.
SDF_API bool HasActive() const
Returns true if this prim spec has an opinion about active.
SDF_API void SetHidden(bool value)
Sets whether this prim spec will be hidden in browsers.
SDF_API bool GetActive() const
SDF_API void RemoveFromPropertyOrderByIndex(int index)
Remove a property name from the property order by index.
static SDF_API bool IsValidName(const std::string &name)
Returns true if the given string is a valid prim name.
SDF_API bool HasKind() const
Returns true if this prim spec has an opinion about kind.
#define SDF_API
Definition: api.h:23
SDF_API void RemoveFromNameChildrenOrderByIndex(int index)
Removes a name child name from the name children order by index.
SDF_API void SetSymmetryFunction(const TfToken &functionName)
SDF_API bool CanSetName(const std::string &newName, std::string *whyNot) const
SDF_API SdfDictionaryProxy GetCustomData() const
SDF_API void RemoveVariantSet(const std::string &name)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
SDF_API VtDictionary GetPrefixSubstitutions() const
SDF_API void SetSpecifier(SdfSpecifier value)
Sets the spec specifier (def or over).
SDF_API SdfVariantSetNamesProxy GetVariantSetNameList() const
SDF_API bool InsertNameChild(const SdfPrimSpecHandle &child, int index=-1)
SDF_API void ApplyNameChildrenOrder(std::vector< TfToken > *vec) const
SDF_API void ClearKind()
Remove the kind opinion from this prim spec if there is one.
SDF_API bool HasNameChildrenOrder() const
Returns true if this prim has name children order specified.
SDF_API std::string GetPrefix() const
GLuint index
Definition: glcorearb.h:786
SDF_API SdfDictionaryProxy GetAssetInfo() const
SDF_API void SetSuffixSubstitutions(const VtDictionary &suffixSubstitutions)
Sets the suffixSubstitutions dictionary for this prim spec.
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
SDF_API void ClearSpecializesList()
Clears the specializes for this prim.
SDF_API void SetAssetInfo(const std::string &name, const VtValue &value)
SdfPropertySpecView PropertySpecView
Definition: primSpec.h:63
SDF_API SdfRelationshipSpecHandle GetRelationshipAtPath(const SdfPath &path) const
SDF_API void SetPropertyOrder(const std::vector< TfToken > &names)
SDF_API SdfRelocatesMapProxy GetRelocates() const
SDF_API SdfPayloadsProxy GetPayloadList() const
SDF_API void ClearInheritPathList()
Clears the inherit paths for this prim.
SDF_API bool GetInstanceable() const
Returns the value for the prim's instanceable flag.
SDF_API TfToken GetTypeName() const
SDF_API std::string GetDocumentation() const
SDF_API SdfSpecifier GetSpecifier() const
Returns the spec specifier (def, over or class).
SDF_API SdfPrimSpecHandle GetNameParent() const
SDF_API SdfSpecializesProxy GetSpecializesList() const
SDF_API SdfReferencesProxy GetReferenceList() const
SDF_API void ApplyPropertyOrder(std::vector< TfToken > *vec) const
SDF_API void SetInstanceable(bool instanceable)
Sets the value for the prim's instanceable flag.
SDF_API SdfNameChildrenOrderProxy GetNameChildrenOrder() const
SDF_API void SetPrefixSubstitutions(const VtDictionary &prefixSubstitutions)
Sets the prefixSubstitutions dictionary for this prim spec.
SDF_API bool HasInheritPaths() const
Returns true if this prim has inherit paths set.
Definition: value.h:146
SDF_API void ClearPayloadList()
Clears the payloads for this prim.
SdfPermission
Definition: types.h:132
SDF_API void SetSymmetricPeer(const std::string &peerName)
SDF_API void InsertInNameChildrenOrder(const TfToken &name, int index=-1)
SdfAttributeSpecView AttributeSpecView
Definition: primSpec.h:64