24 #ifndef PXR_USD_SDF_PRIM_SPEC_H
25 #define PXR_USD_SDF_PRIM_SPEC_H
30 #include "pxr/usd/sdf/declareSpec.h"
32 #include "pxr/usd/sdf/path.h"
34 #include "pxr/usd/sdf/proxyTypes.h"
36 #include "pxr/usd/sdf/api.h"
44 PXR_NAMESPACE_OPEN_SCOPE
93 static SdfPrimSpecHandle
94 New(
const SdfLayerHandle& parentLayer,
96 const std::string& typeName = std::string());
106 static SdfPrimSpecHandle
107 New(
const SdfPrimSpecHandle& parentPrim,
109 const std::string& typeName = std::string());
116 const std::string&
GetName()
const;
128 bool CanSetName(
const std::string& newName, std::string* whyNot)
const;
141 bool SetName(
const std::string& newName,
bool validate =
true);
247 bool InsertProperty(
const SdfPropertySpecHandle& property,
int index = -1);
474 void SetPrefix(
const std::string& value);
484 void SetSuffix(
const std::string& value);
670 std::vector<std::string>
GetVariantNames(
const std::string& name)
const;
698 const std::string& variantName);
742 bool _IsPseudoRoot()
const;
751 bool _ValidateEdit(
const TfToken& key)
const;
754 static SdfPrimSpecHandle
755 _New(
const SdfPrimSpecHandle &parentPrim,
785 PXR_NAMESPACE_CLOSE_SCOPE
787 #endif // PXR_USD_SDF_PRIM_SPEC_H
SDF_API bool SdfJustCreatePrimInLayer(const SdfLayerHandle &layer, const SdfPath &primPath)
Convenience function to create a prim at the given path, and any necessary parent prims...
SDF_API TfToken GetNameToken() const
Returns the prim's name, as a token.
SDF_API bool SetName(const std::string &newName, bool validate=true)
Sets the prim's name.
SDF_API void SetComment(const std::string &value)
Sets the comment string for this prim spec.
Standard pointer typedefs.
SDF_API bool HasInheritPaths() const
Returns true if this prim has inherit paths set.
std::map< SdfPath, SdfPath > SdfRelocatesMap
A map of source SdfPaths to target SdfPaths for relocation.
SDF_API bool GetActive() const
Returns whether this prim spec is active.
static SDF_API SdfPrimSpecHandle New(const SdfLayerHandle &parentLayer, const std::string &name, SdfSpecifier spec, const std::string &typeName=std::string())
Create a root prim spec.
Represents a set of list editing operations.
SDF_API SdfInheritsProxy GetInheritPathList() const
Returns a proxy for the prim's inherit paths.
SDF_API bool GetHidden() const
Returns whether this prim spec will be hidden in browsers.
SDF_API void SetSymmetricPeer(const std::string &peerName)
Sets a symmetric peer for this prim.
SDF_API bool InsertProperty(const SdfPropertySpecHandle &property, int index=-1)
Inserts a property.
A map with string keys and VtValue values.
Base class for all Sdf spec classes.
SDF_API void SetSuffix(const std::string &value)
Sets the suffix string for this prim spec.
SDF_API SdfVariantSelectionProxy GetVariantSelections() const
Returns an editable map whose keys are variant set names and whose values are the variants selected f...
SDF_API void SetProperties(const SdfPropertySpecHandleVector &)
Updates properties to match the given vector of properties.
SDF_API SdfPrimSpecHandle SdfCreatePrimInLayer(const SdfLayerHandle &layer, const SdfPath &primPath)
Convenience function to create a prim at the given path, and any necessary parent prims...
SDF_API void BlockVariantSelection(const std::string &variantSetName)
Blocks the variant selected for the given variant set by setting the variant selection to empty...
SDF_API void SetInstanceable(bool instanceable)
Sets the value for the prim's instanceable flag.
SDF_API bool HasRelocates() const
Returns true if this prim has any relocates opinion, including that there should be no relocates (i...
SDF_API void ApplyPropertyOrder(std::vector< TfToken > *vec) const
Reorders the given list of property names according to the reorder properties statement for this prim...
SDF_API std::string GetDocumentation() const
Returns the documentation string for this prim spec.
SDF_API void SetSymmetryFunction(const TfToken &functionName)
Sets the symmetry function for this prim.
SDF_API void SetSpecifier(SdfSpecifier value)
Sets the spec specifier (def or over).
SDF_API SdfPropertySpecHandle GetPropertyAtPath(const SdfPath &path) const
Returns a property given its path.
SDF_API VtDictionary GetSuffixSubstitutions() const
Returns the suffixSubstitutions dictionary for this prim spec.
SDF_API SdfPrimSpecHandle GetPrimAtPath(const SdfPath &path) const
Returns a prim given its path.
SDF_API TfToken GetTypeName() const
Returns the typeName of the model prim.
SDF_API void SetRelocates(const SdfRelocatesMap &newMap)
Set the entire map of namespace relocations specified on this prim.
SDF_API void InsertInPropertyOrder(const TfToken &name, int index=-1)
Add a new property name in the property order.
SDF_API bool GetInstanceable() const
Returns the value for the prim's instanceable flag.
SDF_API void SetTypeName(const std::string &value)
Sets the typeName of the model prim.
SDF_API void SetActive(bool value)
Sets whether this prim spec is active.
SDF_API void RemoveFromNameChildrenOrder(const TfToken &name)
Removes a name child name from the name children order.
SDF_API void RemoveProperty(const SdfPropertySpecHandle &property)
Removes the property.
Token for efficient comparison, assignment, and hashing of known strings.
SDF_API bool HasReferences() const
Returns true if this prim has references set.
SDF_API SdfDictionaryProxy GetAssetInfo() const
Returns the asset info dictionary for this prim.
SDF_API TfToken GetKind() const
Returns this prim spec's kind.
SDF_API SdfRelocatesMapProxy GetRelocates() const
Get an editing proxy for the map of namespace relocations specified on this prim. ...
SDF_API void ClearActive()
Removes the active opinion in this prim spec if there is one.
SDF_API SdfVariantSetsProxy GetVariantSets() const
Returns the variant sets.
SDF_API void ClearSpecializesList()
Clears the specializes for this prim.
SDF_API void SetAssetInfo(const std::string &name, const VtValue &value)
Sets a asset info entry for this prim.
Represents a single list of list editing operations.
SDF_API PropertySpecView GetProperties() const
Returns the prim's properties.
SDF_API bool HasActive() const
Returns true if this prim spec has an opinion about active.
SDF_API SdfDictionaryProxy GetCustomData() const
Returns the custom data for this prim.
SDF_API void SetPrefixSubstitutions(const VtDictionary &prefixSubstitutions)
Sets the prefixSubstitutions dictionary for this prim spec.
SDF_API bool HasKind() const
Returns true if this prim spec has an opinion about kind.
static SDF_API bool IsValidName(const std::string &name)
Returns true if the given string is a valid prim name.
SDF_API SdfNameChildrenOrderProxy GetNameChildrenOrder() const
Returns the list of child names for this prim's reorder.
SDF_API SdfPrimSpecHandle GetNameParent() const
Returns the prim's namespace parent.
SDF_API bool HasNameChildrenOrder() const
Returns true if this prim has name children order specified.
SDF_API bool HasPayloads() const
Returns true if this prim has payloads set.
SDF_API void SetCustomData(const std::string &name, const VtValue &value)
Sets a custom data entry for this prim.
SDF_API SdfAttributeSpecHandle GetAttributeAtPath(const SdfPath &path) const
Returns an attribute given its path.
SDF_API bool HasInstanceable() const
Returns true if this prim spec has a value authored for its instanceable flag, false otherwise...
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
A proxy for editing map-like values.
SDF_API void ClearRelocates()
Clears the relocates opinion for this prim.
SDF_API SdfPermission GetPermission() const
Returns the prim's permission restriction.
SDF_API bool HasPropertyOrder() const
Returns true if this prim has a property ordering specified.
A path value used to locate objects in layers or scenegraphs.
SDF_API SdfRelationshipSpecHandle GetRelationshipAtPath(const SdfPath &path) const
Returns a relationship given its path.
SDF_API bool InsertNameChild(const SdfPrimSpecHandle &child, int index=-1)
Inserts a child.
SDF_API SdfPayloadsProxy GetPayloadList() const
Returns a proxy for the prim's payloads.
SDF_API void SetPermission(SdfPermission value)
Sets the prim's permission restriction.
SDF_API std::string GetSuffix() const
Returns the suffix string for this prim spec.
SDF_API NameChildrenView GetNameChildren() const
Returns a keyed vector view of the prim's namespace children.
SDF_API SdfPrimSpecHandle GetRealNameParent() const
Returns the prim's namespace parent.
SDF_API void SetHidden(bool value)
Sets whether this prim spec will be hidden in browsers.
SDF_API void ClearInstanceable()
Clears the value for the prim's instanceable flag.
SDF_API void SetNameChildren(const SdfPrimSpecHandleVector &)
Updates nameChildren to match the given vector of prims.
SDF_API const std::string & GetName() const
Returns the prim's name.
SDF_API std::string GetPrefix() const
Returns the prefix string for this prim spec.
SDF_API void SetNameChildrenOrder(const std::vector< TfToken > &names)
Given a list of (possibly sparse) child names, authors a reorder nameChildren statement for this prim...
SDF_API AttributeSpecView GetAttributes() const
Returns a view of the attributes of this prim.
SDF_API bool HasVariantSetNames() const
Returns true if this prim has variant sets set.
SDF_API SdfSpecializesProxy GetSpecializesList() const
Returns a proxy for the prim's specializes paths.
SDF_API VtDictionary GetPrefixSubstitutions() const
Returns the prefixSubstitutions dictionary for this prim spec.
SDF_API std::vector< std::string > GetVariantNames(const std::string &name) const
Returns list of variant names for the given variant set.
SDF_API SdfSpecifier GetSpecifier() const
Returns the spec specifier (def, over or class).
SDF_API SdfDictionaryProxy GetSymmetryArguments() const
Returns the symmetry arguments for this prim.
SDF_API void ClearReferenceList()
Clears the references for this prim.
Represents a prim description in an SdfLayer object.
SDF_API void RemoveVariantSet(const std::string &name)
Removes the variant set with the given name.
SDF_API SdfPropertyOrderProxy GetPropertyOrder() const
Returns the list of property names for this prim's reorder properties statement.
SDF_API void ClearInheritPathList()
Clears the inherit paths for this prim.
SDF_API void SetPropertyOrder(const std::vector< TfToken > &names)
Given a list of (possibly sparse) property names, authors a reorder properties statement for this pri...
SDF_API void SetKind(const TfToken &value)
Sets this prim spec's kind.
SDF_API void RemoveFromPropertyOrderByIndex(int index)
Remove a property name from the property order by index.
SDF_API SdfSpecHandle GetObjectAtPath(const SdfPath &path) const
Returns the object for the given path.
SDF_API SdfReferencesProxy GetReferenceList() const
Returns a proxy for the prim's references.
Provides a view onto an object's children.
SDF_API std::string GetComment() const
Returns the comment string for this prim spec.
SDF_API void SetVariantSelection(const std::string &variantSetName, const std::string &variantName)
Sets the variant selected for the given variant set.
SDF_API void RemoveFromPropertyOrder(const TfToken &name)
Remove a property name from the property order.
SDF_API bool RemoveNameChild(const SdfPrimSpecHandle &child)
Removes the child. Returns true if successful, false if failed.
SDF_API void SetPrefix(const std::string &value)
Sets the prefix string for this prim spec.
SDF_API void ApplyNameChildrenOrder(std::vector< TfToken > *vec) const
Reorders the given list of child names according to the reorder nameChildren statement for this prim...
SDF_API SdfPrimSpecHandle GetNameRoot() const
Returns the prim's namespace pseudo-root prim.
SDF_API SdfVariantSetNamesProxy GetVariantSetNameList() const
Returns a proxy for the prim's variant sets.
SDF_API bool CanSetName(const std::string &newName, std::string *whyNot) const
Returns true if setting the prim spec's name to newName will succeed.
SDF_API void ClearPayloadList()
Clears the payloads for this prim.
SDF_API void SetSymmetryArgument(const std::string &name, const VtValue &value)
Sets a symmetry argument for this prim.
SDF_API std::string GetSymmetricPeer() const
Returns the symmetric peer for this prim.
SDF_API void SetDocumentation(const std::string &value)
Sets the documentation string for this prim spec.
SDF_API void RemoveFromNameChildrenOrderByIndex(int index)
Removes a name child name from the name children order by index.
SDF_API void InsertInNameChildrenOrder(const TfToken &name, int index=-1)
Adds a new name child name in the name children order.
SDF_API void SetSuffixSubstitutions(const VtDictionary &suffixSubstitutions)
Sets the suffixSubstitutions dictionary for this prim spec.
SDF_API bool HasSpecializes() const
Returns true if this prim has specializes set.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
SDF_API void ClearKind()
Remove the kind opinion from this prim spec if there is one.
SDF_API RelationshipSpecView GetRelationships() const
Returns a view of the relationships of this prim.
SdfPermission
An enum that defines permission levels.
SDF_API TfToken GetSymmetryFunction() const
Returns the symmetry function for this prim.