24 #ifndef PXR_USD_USD_PRIM_H
25 #define PXR_USD_USD_PRIM_H
30 #include "pxr/usd/usd/api.h"
35 #include "pxr/usd/sdf/schema.h"
43 #include "pxr/usd/sdf/path.h"
45 #include <boost/iterator/iterator_adaptor.hpp>
46 #include <boost/range/iterator_range.hpp>
49 #include <type_traits>
52 PXR_NAMESPACE_OPEN_SCOPE
155 return _Prim()->GetPrimTypeInfo();
162 return _Prim()->GetPrimDefinition();
187 return SetMetadata(SdfFieldKeys->Specifier, specifier);
201 return SetMetadata(SdfFieldKeys->TypeName, typeName);
219 bool IsActive()
const {
return _Prim()->IsActive(); }
249 bool IsLoaded()
const {
return _Prim()->IsLoaded(); }
253 bool IsModel()
const {
return _Prim()->IsModel(); }
258 bool IsGroup()
const {
return _Prim()->IsGroup(); }
270 return _Prim()->HasDefiningSpecifier();
285 std::function<bool (const TfToken &propertyName)>;
395 std::vector<UsdProperty>
403 std::vector<UsdProperty>
412 std::vector<UsdProperty>
414 const std::vector<std::string> &namespaces)
const;
422 std::vector<UsdProperty>
477 bool _IsA(
const TfType& schemaType,
bool validateSchemaType)
const;
488 bool _HasAPI(
const TfType& schemaType,
bool validateSchemaType,
489 const TfToken &instanceName)
const;
498 bool _CanApplyAPI(
const TfType& schemaType,
499 std::string *whyNot)
const;
502 bool _CanApplyAPI(
const TfType& schemaType,
504 std::string *whyNot)
const;
507 bool _ApplyAPI(
const TfType& schemaType)
const;
510 bool _ApplyAPI(
const TfType& schemaType,
511 const TfToken& instanceName)
const;
514 bool _RemoveAPI(
const TfType& schemaType)
const;
517 bool _RemoveAPI(
const TfType& schemaType,
518 const TfToken& instanceName)
const;
525 template <
typename T>
527 static_assert(std::is_base_of<UsdSchemaBase, T>::value,
528 "Provided type must derive UsdSchemaBase.");
529 return _IsA(TfType::Find<T>(),
false);
537 bool IsA(
const TfType& schemaType)
const;
576 template <
typename T>
578 static_assert(std::is_base_of<UsdAPISchemaBase, T>::value,
579 "Provided type must derive UsdAPISchemaBase.");
580 static_assert(!std::is_same<UsdAPISchemaBase, T>::value,
581 "Provided type must not be UsdAPISchemaBase.");
585 "Provided schema type must be an applied API schema.");
588 && !instanceName.IsEmpty()) {
590 "not contain an application instanceName ( %s ).",
592 instanceName.GetText());
596 return _HasAPI(TfType::Find<T>(),
false,
623 template <
typename SchemaType>
625 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
626 "Provided type must derive UsdAPISchemaBase.");
627 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
628 "Provided type must not be UsdAPISchemaBase.");
630 "Provided schema type must be a single apply API schema.");
632 static const TfType schemaType = TfType::Find<SchemaType>();
633 return _CanApplyAPI(schemaType, whyNot);
644 std::string *whyNot =
nullptr)
const;
659 template <
typename SchemaType>
661 std::string *whyNot =
nullptr)
const {
662 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
663 "Provided type must derive UsdAPISchemaBase.");
664 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
665 "Provided type must not be UsdAPISchemaBase.");
667 "Provided schema type must be a multiple apply API schema.");
669 static const TfType schemaType = TfType::Find<SchemaType>();
670 return _CanApplyAPI(schemaType, instanceName, whyNot);
682 std::string *whyNot =
nullptr)
const;
699 template <
typename SchemaType>
701 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
702 "Provided type must derive UsdAPISchemaBase.");
703 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
704 "Provided type must not be UsdAPISchemaBase.");
706 "Provided schema type must be a single apply API schema.");
708 static const TfType schemaType = TfType::Find<SchemaType>();
709 return _ApplyAPI(schemaType);
741 template <
typename SchemaType>
743 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
744 "Provided type must derive UsdAPISchemaBase.");
745 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
746 "Provided type must not be UsdAPISchemaBase.");
748 "Provided schema type must be a multiple apply API schema.");
750 static const TfType schemaType = TfType::Find<SchemaType>();
751 return _ApplyAPI(schemaType, instanceName);
779 template <
typename SchemaType>
781 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
782 "Provided type must derive UsdAPISchemaBase.");
783 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
784 "Provided type must not be UsdAPISchemaBase.");
786 "Provided schema type must be a single apply API schema.");
788 static const TfType schemaType = TfType::Find<SchemaType>();
789 return _RemoveAPI(schemaType);
822 template <
typename SchemaType>
824 static_assert(std::is_base_of<UsdAPISchemaBase, SchemaType>::value,
825 "Provided type must derive UsdAPISchemaBase.");
826 static_assert(!std::is_same<UsdAPISchemaBase, SchemaType>::value,
827 "Provided type must not be UsdAPISchemaBase.");
829 "Provided schema type must be a multiple apply API schema.");
831 static const TfType schemaType = TfType::Find<SchemaType>();
832 return _RemoveAPI(schemaType, instanceName);
843 const TfToken& instanceName)
const;
959 const Usd_PrimFlagsPredicate &predicate)
const;
1039 Usd_PrimDataConstPtr prim = get_pointer(_Prim());
1040 SdfPath proxyPrimPath = _ProxyPrimPath();
1041 Usd_MoveToParent(prim, proxyPrimPath);
1042 return UsdPrim(prim, proxyPrimPath);
1063 const Usd_PrimFlagsPredicate &predicate)
const;
1207 const std::vector<std::string> &nameElts,
1216 const std::vector<std::string> &nameElts,
1257 std::function<
bool (
UsdAttribute const &)>
const &pred =
nullptr,
1258 bool recurseOnSources =
false)
const;
1302 bool custom=
true)
const;
1352 bool recurseOnTargets =
false)
const;
1388 const std::string& assetPath,
const SdfPath& primPath)
const;
1501 bool instanceable =
false;
1502 return GetMetadata(SdfFieldKeys->Instanceable, &instanceable) &&
1509 return SetMetadata(SdfFieldKeys->Instanceable, instanceable);
1535 return Usd_IsInstanceProxy(_Prim(), _ProxyPrimPath());
1650 friend class Usd_PrimData;
1651 friend class Usd_PrimFlagsPredicate;
1652 friend struct UsdPrim_RelTargetFinder;
1653 friend struct UsdPrim_AttrConnectionFinder;
1656 UsdPrim(
const Usd_PrimDataHandle &primData,
1658 :
UsdObject(primData, proxyPrimPath) { }
1662 const Usd_PrimDataHandle &prim,
1665 :
UsdObject(objType, prim, proxyPrimPath, propName) {}
1669 _MakeSiblingRange(
const Usd_PrimFlagsPredicate &pred)
const;
1673 _MakeDescendantsRange(
const Usd_PrimFlagsPredicate &pred)
const;
1676 std::vector<UsdProperty>
1682 bool applyOrder=
true,
1686 std::vector<UsdProperty>
1687 _GetPropertiesInNamespace(
const std::string &namespaces,
1688 bool onlyAuthored)
const;
1691 std::vector<UsdAttribute>
1692 _GetAttributes(
bool onlyAuthored,
bool applyOrder=
false)
const;
1695 std::vector<UsdRelationship>
1696 _GetRelationships(
bool onlyAuthored,
bool applyOrder=
false)
const;
1709 {
return _Prim()->GetSourcePrimIndex(); }
1763 template <
class ForwardRange>
1767 template <
class ForwardRange>
1777 operator unspecified_bool_type()
const;
1780 bool equal(
const iterator_range&)
const;
1808 UsdPrimSiblingIterator,
1809 const Usd_PrimData *,
1811 boost::forward_traversal_tag,
1823 const Usd_PrimFlagsPredicate &predicate)
1824 : iterator_adaptor_(i)
1825 , _proxyPrimPath(proxyPrimPath)
1826 , _predicate(predicate) {
1828 if (base() && !Usd_EvalPredicate(_predicate, base(), _proxyPrimPath))
1833 friend class boost::iterator_core_access;
1835 return base() == other.base() &&
1836 _proxyPrimPath == other._proxyPrimPath &&
1837 _predicate == other._predicate;
1841 base_type &base = base_reference();
1842 if (Usd_MoveToNextSiblingOrParent(base, _proxyPrimPath, _predicate)) {
1849 return UsdPrim(base(), _proxyPrimPath);
1853 Usd_PrimFlagsPredicate _predicate;
1861 struct Tf_ShouldIterateOverCopy<
1862 UsdPrimSiblingRange> : boost::true_type {};
1864 struct Tf_ShouldIterateOverCopy<
1865 const UsdPrimSiblingRange> : boost::true_type {};
1873 return _MakeSiblingRange(
1874 Usd_CreatePredicateForTraversal(_Prim(), _ProxyPrimPath(), pred));
1891 UsdPrim::_MakeSiblingRange(
const Usd_PrimFlagsPredicate &pred)
const {
1892 Usd_PrimDataConstPtr firstChild = get_pointer(_Prim());
1893 SdfPath firstChildPath = _ProxyPrimPath();
1894 if (!Usd_MoveToChild(firstChild, firstChildPath, pred)) {
1895 firstChild =
nullptr;
1899 return SiblingRange(
1955 template <
class ForwardRange>
1959 template <
class ForwardRange>
1969 operator unspecified_bool_type()
const;
1972 bool equal(
const iterator_range&)
const;
2000 UsdPrimSubtreeIterator,
2001 const Usd_PrimData *,
2003 boost::forward_traversal_tag,
2015 const Usd_PrimFlagsPredicate &predicate)
2016 : iterator_adaptor_(i)
2017 , _proxyPrimPath(proxyPrimPath)
2018 , _predicate(predicate) {
2020 base_type &base = base_reference();
2021 if (base && !Usd_EvalPredicate(_predicate, base, _proxyPrimPath)) {
2022 if (Usd_MoveToNextSiblingOrParent(base, _proxyPrimPath,
2031 friend class boost::iterator_core_access;
2033 return base() == other.base() &&
2034 _proxyPrimPath == other._proxyPrimPath &&
2035 _predicate == other._predicate;
2039 base_type &base = base_reference();
2040 if (!Usd_MoveToChild(base, _proxyPrimPath, _predicate)) {
2041 while (Usd_MoveToNextSiblingOrParent(base, _proxyPrimPath,
2047 return UsdPrim(base(), _proxyPrimPath);
2051 Usd_PrimFlagsPredicate _predicate;
2059 struct Tf_ShouldIterateOverCopy<
2060 UsdPrimSubtreeRange> : boost::true_type {};
2062 struct Tf_ShouldIterateOverCopy<
2063 const UsdPrimSubtreeRange> : boost::true_type {};
2070 return _MakeDescendantsRange(
2071 Usd_CreatePredicateForTraversal(_Prim(), _ProxyPrimPath(), pred));
2088 UsdPrim::_MakeDescendantsRange(
const Usd_PrimFlagsPredicate &pred)
const {
2089 Usd_PrimDataConstPtr firstChild = get_pointer(_Prim());
2090 SdfPath firstChildPath = _ProxyPrimPath();
2091 Usd_PrimDataConstPtr endChild = firstChild;
2092 SdfPath endChildPath = firstChildPath;
2093 if (Usd_MoveToChild(firstChild, firstChildPath, pred)) {
2094 while (Usd_MoveToNextSiblingOrParent(endChild, endChildPath, pred)) {}
2097 return SubtreeRange(
2109 return UsdPrim(_prim, _proxyPrimPath);
2112 PXR_NAMESPACE_CLOSE_SCOPE
2114 #endif // PXR_USD_USD_PRIM_H
USD_API SdfPathVector FindAllAttributeConnectionPaths(std::function< bool(UsdAttribute const &)> const &pred=nullptr, bool recurseOnSources=false) const
Search the prim subtree rooted at this prim for attributes for which predicate returns true...
USD_API bool HasAuthoredPayloads() const
Return true if this prim has any authored payloads.
A proxy class for applying listOp edits to the specializes list for a prim.
USD_API UsdAttribute CreateAttribute(const TfToken &name, const SdfValueTypeName &typeName, bool custom, SdfVariability variability=SdfVariabilityVarying) const
Author scene description for the attribute named attrName at the current EditTarget if none already e...
USD_API TfTokenVector GetPropertyOrder() const
Return the strongest propertyOrder metadata value authored on this prim.
SdfSpecifier GetSpecifier() const
Return this prim's composed specifier.
iterator::value_type value_type
Iterator value_type.
SiblingRange GetAllChildren() const
Return all this prim's children as an iterable range.
USD_API UsdProperty GetPropertyAtPath(const SdfPath &path) const
Returns the property at path on the same stage as this prim.
USD_API UsdPayloads GetPayloads() const
Return a UsdPayloads object that allows one to add, remove, or mutate payloads at the currently set U...
unspecified integral type difference_type
Iterator difference type.
UsdObjType
Enum values to represent the various Usd object types.
USD_API bool IsPseudoRoot() const
Returns true if the prim is the pseudo root.
USD_API TfTokenVector GetAuthoredPropertyNames(const PropertyPredicateFunc &predicate={}) const
Return this prim's property names (attributes and relationships) that have authored scene description...
USD_API TfTokenVector GetChildrenNames() const
Return the names of the child prims in the order they appear when iterating over GetChildren.
bool HasAuthoredInstanceable() const
Return true if this prim has an authored opinion for 'instanceable', false otherwise.
USD_API bool HasVariantSets() const
Return true if this prim has any authored VariantSets.
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
SubtreeRange GetDescendants() const
Return this prim's active, loaded, defined, non-abstract descendants as an iterable range...
unspecified UsdPrimDefaultPredicate
The default predicate used for prim traversals in methods like UsdPrim::GetChildren, UsdStage::Traverse, and by UsdPrimRange.
bool ApplyAPI(const TfToken &instanceName) const
Applies a multiple-apply API schema with the given C++ type 'SchemaType' and instance name instanceNa...
Standard pointer typedefs.
friend bool operator!=(const UsdPrimSubtreeIterator &lhs, const UsdPrimSubtreeIterator &rhs)
Inequality.
bool ClearInstanceable() const
Remove the authored 'instanceable' opinion at the current EditTarget.
USD_API UsdRelationship CreateRelationship(const TfToken &relName, bool custom=true) const
Author scene description for the relationship named relName at the current EditTarget if none already...
iterator begin() const
First iterator.
bool IsAbstract() const
Return true if this prim or any of its ancestors is a class.
value_type reference
Iterator reference type, in this case the same as value_type.
friend bool operator==(const UsdPrimSiblingIterator &lhs, const UsdPrimSiblingIterator &rhs)
Equality.
reference operator*() const
Dereference.
bool IsA() const
Return true if the prim's schema type, is or inherits schema type T.
UsdPrimSiblingIterator iterator
Iterator type.
friend bool operator!=(const UsdPrimSiblingRange &lhs, const UsdPrimSiblingRange &rhs)
Inequality comparison.
bool IsInstanceProxy() const
Return true if this prim is an instance proxy, false otherwise.
UsdPrim GetParent() const
Return this prim's parent prim.
bool ApplyAPI() const
Applies a single-apply API schema with the given C++ type 'SchemaType' to this prim in the current ed...
void ClearChildrenReorder() const
Remove the opinion for the metadata used to reorder children of this prim at the current EditTarget...
iterator end() const
Past-the-end iterator.
UsdPrim value_type
Iterator value type.
USD_API UsdVariantSet GetVariantSet(const std::string &variantSetName) const
Retrieve a specifically named VariantSet for editing or constructing a UsdEditTarget.
UsdPrim GetPrimInPrototype() const
If this prim is an instance proxy, return the UsdPrim for the corresponding prim in the instance's pr...
USD_API std::vector< UsdRelationship > GetAuthoredRelationships() const
Like GetRelationships(), but exclude relationships without authored scene description from the result...
USD_API std::vector< UsdProperty > GetPropertiesInNamespace(const std::vector< std::string > &namespaces) const
Return this prim's properties that are inside the given property namespace ordered according to the s...
bool IsModel() const
Return true if this prim is a model based on its kind metadata, false otherwise.
USD_API UsdRelationship GetRelationship(const TfToken &relName) const
Return a UsdRelationship with the name relName.
USD_API TfTokenVector GetAppliedSchemas() const
Return a vector containing the names of API schemas which have been applied to this prim...
friend bool operator!=(const UsdPrimSiblingIterator &lhs, const UsdPrimSiblingIterator &rhs)
Inequality.
#define TF_CODING_ERROR(fmt, args)
Issue an internal programming error, but continue execution.
bool ClearTypeName() const
Clear the opinion for this Prim's typeName at the current edit target.
bool HasDefiningSpecifier() const
Return true if this prim has a specifier of type SdfSpecifierDef or SdfSpecifierClass.
USD_API bool ClearMetadata(const TfToken &key) const
Clears the authored key's value at the current EditTarget, returning false on error.
USD_API bool HasAttribute(const TfToken &attrName) const
Return true if this prim has an attribute named attrName, false otherwise.
USD_API bool AddAppliedSchema(const TfToken &appliedSchemaName) const
Adds the applied API schema name token appliedSchemaName to the apiSchemas metadata for this prim at ...
The outermost container for scene description, which owns and presents composed prims as a scenegraph...
reference front() const
Return *begin(). This range must not be empty.
friend bool operator==(const UsdPrimSiblingRange &lhs, const UsdPrimSiblingRange &rhs)
Equality comparison.
Represents a value type name, i.e.
void ClearPropertyOrder() const
Remove the opinion for propertyOrder metadata on this prim at the current EditTarget.
Load a prim plus all its descendants.
A proxy class for applying listOp edits to the inherit paths list for a prim.
friend bool operator!=(const UsdPrimSubtreeRange &lhs, const UsdPrimSubtreeRange &rhs)
Inequality comparison.
static USD_API bool IsPathInPrototype(const SdfPath &path)
Return true if the given path identifies a prototype prim or a prim or property descendant of a proto...
UsdPrimSiblingIterator & operator++()
Postincrement.
bool GetMetadata(const TfToken &key, T *value) const
Resolve the requested metadatum named key into value, returning true on success.
unspecified integral type difference_type
Iterator difference type.
USD_API TfTokenVector GetFilteredChildrenNames(const Usd_PrimFlagsPredicate &predicate) const
Return the names of the child prims in the order they appear when iterating over GetFilteredChildren(...
The base class for all API schemas.
Scenegraph object for authoring and retrieving numeric, string, and array valued data, sampled over time.
USD_API bool HasAuthoredReferences() const
Return true if this prim has any authored references.
USD_API bool RemoveProperty(const TfToken &propName)
Remove all scene description for the property with the given propName in the current UsdEditTarget...
bool IsPrototype() const
Return true if this prim is an instancing prototype prim, false otherwise.
USD_API UsdPrim GetPrototype() const
If this prim is an instance, return the UsdPrim for the corresponding prototype.
Forward iterator range of sibling UsdPrim s.
USD_API void Load(UsdLoadPolicy policy=UsdLoadWithDescendants) const
Load this prim, all its ancestors, and by default all its descendants.
UsdReferences provides an interface to authoring and introspecting references in Usd.
bool RemoveAPI(const TfToken &instanceName) const
Removes a multiple-apply API schema with the given C++ type 'SchemaType' and instance name instanceNa...
USD_API std::vector< UsdPrim > GetInstances() const
If this prim is a prototype prim, returns all prims that are instances of this prototype.
UsdPrimSubtreeIterator iterator
Iterator type.
iterator::value_type value_type
Iterator value_type.
bool HasAuthoredActive() const
Return true if this prim has an authored opinion for 'active', false otherwise.
void SetChildrenReorder(const TfTokenVector &order) const
Author an opinion for the metadata used to reorder children of this prim at the current EditTarget...
bool IsInPrototype() const
Return true if this prim is a prototype prim or a descendant of a prototype prim, false otherwise...
const UsdPrimTypeInfo & GetPrimTypeInfo() const
Return the prim's full type info composed from its type name, applied API schemas, and any fallback types defined on the stage for unrecognized prim type names.
Token for efficient comparison, assignment, and hashing of known strings.
SiblingRange GetFilteredChildren(const Usd_PrimFlagsPredicate &predicate) const
Return a subset of all of this prim's children filtered by predicate as an iterable range...
USD_API bool HasPayload() const
bool SetMetadata(const TfToken &key, const T &value) const
Set metadatum key's value to value.
unspecified integral type difference_type
Iterator difference type.
iterator_range & advance_end(difference_type n)
Advance this range's end iterator.
USD_API UsdPrim GetChild(const TfToken &name) const
Return this prim's direct child named name if it has one, otherwise return an invalid UsdPrim...
UsdPrimSiblingRange(UsdPrimSiblingIterator begin, UsdPrimSiblingIterator end)
Construct with a pair of iterators.
USD_API std::vector< UsdAttribute > GetAttributes() const
Like GetProperties(), but exclude all relationships from the result.
USD_API UsdPrim GetNextSibling() const
Return this prim's next active, loaded, defined, non-abstract sibling if it has one, otherwise return an invalid UsdPrim.
USD_API std::vector< UsdRelationship > GetRelationships() const
Like GetProperties(), but exclude all attributes from the result.
void SetPropertyOrder(const TfTokenVector &order) const
Author an opinion for propertyOrder metadata on this prim at the current EditTarget.
UsdPrimSubtreeIterator & operator++()
Postincrement.
USD_API SdfPrimSpecHandleVector GetPrimStack() const
Return all the authored SdfPrimSpecs that may contain opinions for this prim in order from strong to ...
bool SetSpecifier(SdfSpecifier specifier) const
Author an opinion for this Prim's specifier at the current edit target.
static TF_API std::string GetCanonicalTypeName(const std::type_info &)
Return the canonical typeName used for a given std::type_info.
USD_API std::vector< UsdProperty > GetAuthoredProperties(const PropertyPredicateFunc &predicate={}) const
Return this prim's properties (attributes and relationships) that have authored scene description...
A UsdVariantSet represents a single VariantSet in USD (e.g.
bool SetTypeName(const TfToken &typeName) const
Author this Prim's typeName at the current EditTarget.
USD_API UsdRelationship GetRelationshipAtPath(const SdfPath &path) const
Returns the relationship at path on the same stage as this prim.
UsdPrim GetPrim() const
Return this object if it is a prim, otherwise return this object's nearest owning prim...
Forward iterator range of sibling UsdPrim s.
bool CanApplyAPI(const TfToken &instanceName, std::string *whyNot=nullptr) const
Returns whether a multiple-apply API schema with the given C++ type 'SchemaType' can be applied to th...
bool CanApplyAPI(std::string *whyNot=nullptr) const
Returns whether a single-apply API schema with the given C++ type 'SchemaType' can be applied to this...
const TfToken & GetTypeName() const
Return this prim's composed type name.
Base class for Usd scenegraph objects, providing common API.
USD_API std::vector< UsdAttribute > GetAuthoredAttributes() const
Like GetAttributes(), but exclude attributes without authored scene description from the result...
Represents a payload and all its meta data.
bool empty() const
Return begin() == end().
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
UsdPrimSiblingRange & operator=(const ForwardRange &r)
Assign from another compatible range type.
USD_API TfTokenVector GetAllChildrenNames() const
Return the names of the child prims in the order they appear when iterating over GetAllChildren.
SdfSpecifier
An enum that identifies the possible specifiers for an SdfPrimSpec.
UsdPrim value_type
Iterator value type.
std::vector< TfToken > TfTokenVector
Convenience types.
friend bool operator==(const UsdPrimSubtreeRange &lhs, const UsdPrimSubtreeRange &rhs)
Equality comparison.
UsdPrimSubtreeRange & operator=(const ForwardRange &r)
Assign from another compatible range type.
A path value used to locate objects in layers or scenegraphs.
bool HasAuthoredTypeName() const
Return true if a typeName has been authored.
USD_API bool RemoveAppliedSchema(const TfToken &appliedSchemaName) const
Removes the applied API schema name token appliedSchemaName from the apiSchemas metadata for this pri...
bool IsActive() const
Return true if this prim is active, meaning neither it nor any of its ancestors have active=false...
iterator_range & advance_begin(difference_type n)
Advance this range's begin iterator.
USD_API UsdReferences GetReferences() const
Return a UsdReferences object that allows one to add, remove, or mutate references at the currently s...
iterator::reference reference
Iterator reference_type.
SubtreeRange GetFilteredDescendants(const Usd_PrimFlagsPredicate &predicate) const
Return a subset of all of this prim's descendants filtered by predicate as an iterable range...
USD_API UsdAttribute GetAttributeAtPath(const SdfPath &path) const
Returns the attribute at path on the same stage as this prim.
UsdPayloads provides an interface to authoring and introspecting payloads.
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
USD_API PcpPrimIndex ComputeExpandedPrimIndex() const
Compute the prim index containing all sites that could contribute opinions to this prim...
USD_API TfTokenVector GetPropertyNames(const PropertyPredicateFunc &predicate={}) const
Return all of this prim's property names (attributes and relationships), including all builtin proper...
SdfVariability
An enum that identifies variability types for attributes.
USD_API bool SetPayload(const SdfPayload &payload) const
iterator begin() const
First iterator.
bool SetActive(bool active) const
Author 'active' metadata for this prim at the current EditTarget.
Class that holds the full type information for a prim.
bool IsDefined() const
Return true if this prim and all its ancestors have defining specifiers, false otherwise.
friend bool operator==(const UsdPrimSubtreeIterator &lhs, const UsdPrimSubtreeIterator &rhs)
Equality.
UsdLoadPolicy
Controls UsdStage::Load() and UsdPrim::Load() behavior regarding whether or not descendant prims are ...
USD_API bool HasAuthoredMetadata(const TfToken &key) const
Returns true if the key has an authored value, false if no value was authored or the only value avail...
Multiple Apply API Schema.
Base class for UsdAttribute and UsdRelationship scenegraph objects.
bool IsLoaded() const
Return true if this prim is active, and either it is loadable and it is loaded, or its nearest loadab...
USD_API bool HasAuthoredInherits() const
Return true if this prim has any authored inherits.
An forward-iterable range that traverses a subtree of prims rooted at a given prim in depth-first ord...
reference operator*() const
Dereference.
USD_API UsdObject GetObjectAtPath(const SdfPath &path) const
Returns the object at path on the same stage as this prim.
unspecified integral type difference_type
Iterator difference type.
bool RemoveAPI() const
Removes a single-apply API schema with the given C++ type 'SchemaType' from this prim in the current ...
USD_API UsdVariantSets GetVariantSets() const
Return a UsdVariantSets object representing all the VariantSets present on this prim.
Class representing the builtin definition of a prim given the schemas registered in the schema regist...
USD_API UsdPrim GetPrimAtPath(const SdfPath &path) const
Returns the prim at path on the same stage as this prim.
bool IsInstance() const
Return true if this prim is an instance of a prototype, false otherwise.
unspecified type operator->() const
Indirection.
USD_API bool HasRelationship(const TfToken &relName) const
Return true if this prim has a relationship named relName, false otherwise.
Forward traversal iterator of sibling UsdPrim s.
unspecified UsdPrimAllPrimsPredicate
Predicate that includes all prims.
UsdPrim()
Construct an invalid prim.
std::function< bool(const TfToken &propertyName)> PropertyPredicateFunc
Alias for the "predicate" function parameter passed into the various Get{Authored}{PropertyNames,Properties} methods.
USD_API SdfPathVector FindAllRelationshipTargetPaths(std::function< bool(UsdRelationship const &)> const &pred=nullptr, bool recurseOnTargets=false) const
Search the prim subtree rooted at this prim for relationships for which predicate returns true...
TfType represents a dynamic runtime type.
UsdPrimSubtreeIterator SubtreeIterator
Convenience typedefs.
const SdfPath & GetPrimPath() const
Return this object's path if this object is a prim, otherwise this object's nearest owning prim's pat...
reference front() const
Return *begin(). This range must not be empty.
USD_API bool HasProperty(const TfToken &propName) const
Return true if this prim has an property named propName, false otherwise.
USD_API UsdSpecializes GetSpecializes() const
Return a UsdSpecializes object that allows one to add, remove, or mutate specializes at the currently...
bool equal(const iterator_range &) const
Equality compare.
USD_API UsdAttribute GetAttribute(const TfToken &attrName) const
Return a UsdAttribute with the name attrName.
UsdPrimSiblingIterator SiblingIterator
Convenience typedefs.
USD_API std::vector< UsdProperty > GetProperties(const PropertyPredicateFunc &predicate={}) const
Return all of this prim's properties (attributes and relationships), including all builtin properties...
USD_API void Unload() const
Unloads this prim and all its descendants.
UsdPrimSiblingIterator const_iterator
Const iterator type.
USD_API std::vector< UsdProperty > GetAuthoredPropertiesInNamespace(const std::vector< std::string > &namespaces) const
Like GetPropertiesInNamespace(), but exclude properties that do not have authored scene description f...
bool empty() const
Return begin() == end().
UsdVariantSets represents the collection of VariantSets that are present on a UsdPrim.
USD_API bool ClearPayload() const
bool SetInstanceable(bool instanceable) const
Author 'instanceable' metadata for this prim at the current EditTarget.
UsdPrimSubtreeIterator const_iterator
Const iterator type.
The base class for all schema types in Usd.
SiblingRange GetChildren() const
Return this prim's active, loaded, defined, non-abstract children as an iterable range.
iterator::reference reference
Iterator reference_type.
USD_API UsdInherits GetInherits() const
Return a UsdInherits object that allows one to add, remove, or mutate inherits at the currently set U...
unspecified type operator->() const
Indirection.
Forward traversal iterator of sibling UsdPrim s.
iterator end() const
Past-the-end iterator.
bool equal(const iterator_range &) const
Equality compare.
const UsdPrimDefinition & GetPrimDefinition() const
Return this prim's definition based on the prim's type if the type is a registered prim type...
SubtreeRange GetAllDescendants() const
Return all this prim's descendants as an iterable range.
USD_API bool HasAuthoredSpecializes() const
Returns true if this prim has any authored specializes.
iterator_range & advance_end(difference_type n)
Advance this range's end iterator.
USD_API UsdProperty GetProperty(const TfToken &propName) const
Return a UsdProperty with the name propName.
bool IsGroup() const
Return true if this prim is a model group based on its kind metadata, false otherwise.
UsdPrimSubtreeRange(UsdPrimSubtreeIterator begin, UsdPrimSubtreeIterator end)
Construct with a pair of iterators.
const PcpPrimIndex & GetPrimIndex() const
Return the cached prim index containing all sites that can contribute opinions to this prim...
static USD_API bool IsPrototypePath(const SdfPath &path)
Return true if the given path identifies a prototype prim, false otherwise.
bool ClearActive() const
Remove the authored 'active' opinion at the current EditTarget.
USD_API TfTokenVector GetChildrenReorder() const
Return the strongest opinion for the metadata used to reorder children of this prim.
value_type reference
Iterator reference type, in this case the same as value_type.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
bool HasAPI(const TfToken &instanceName=TfToken()) const
Return true if the UsdPrim has had an API schema represented by the C++ class type T applied to it th...
bool IsInstanceable() const
Return true if this prim has been marked as instanceable.
iterator_range & advance_begin(difference_type n)
Advance this range's begin iterator.
USD_API UsdPrim GetFilteredNextSibling(const Usd_PrimFlagsPredicate &predicate) const
Return this prim's next sibling that matches predicate if it has one, otherwise return the invalid Us...