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