|
A general purpose API schema used to describe a collection of prims and properties within a scene. More...
#include <collectionAPI.h>
Public Types | |
using | MembershipQuery = UsdCollectionMembershipQuery |
Public Member Functions | |
UsdCollectionAPI (const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken()) | |
Construct a UsdCollectionAPI on UsdPrim prim with name name . | |
UsdCollectionAPI (const UsdSchemaBase &schemaObj, const TfToken &name) | |
Construct a UsdCollectionAPI on the prim held by schemaObj with name name . | |
virtual USD_API | ~UsdCollectionAPI () |
Destructor. | |
TfToken | GetName () const |
Returns the name of this multiple-apply schema instance. | |
USD_API UsdAttribute | GetExpansionRuleAttr () const |
Specifies how the paths that are included in the collection must be expanded to determine its members. | |
USD_API UsdAttribute | CreateExpansionRuleAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetExpansionRuleAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API UsdAttribute | GetIncludeRootAttr () const |
Boolean attribute indicating whether the pseudo-root path </> should be counted as one of the included target paths. | |
USD_API UsdAttribute | CreateIncludeRootAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetIncludeRootAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API UsdAttribute | GetMembershipExpressionAttr () const |
Specifies a path expression that determines membership in this collection. | |
USD_API UsdAttribute | CreateMembershipExpressionAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetMembershipExpressionAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API UsdAttribute | GetCollectionAttr () const |
This property represents the collection for the purpose of allowing another collection to include it. | |
USD_API UsdAttribute | CreateCollectionAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetCollectionAttr(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API UsdRelationship | GetIncludesRel () const |
Specifies a list of targets that are included in the collection. | |
USD_API UsdRelationship | CreateIncludesRel () const |
See GetIncludesRel(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API UsdRelationship | GetExcludesRel () const |
Specifies a list of targets that are excluded below the included paths in this collection. | |
USD_API UsdRelationship | CreateExcludesRel () const |
See GetExcludesRel(), and also Create vs Get Property Methods for when to use Get vs Create. | |
USD_API SdfPath | GetCollectionPath () const |
Returns the canonical path that represents this collection. | |
USD_API SdfPathExpression | ResolveCompleteMembershipExpression () const |
Obtain a complete SdfPathExpression from this collection's membershipExpression. | |
USD_API UsdCollectionMembershipQuery | ComputeMembershipQuery () const |
Computes and returns a UsdCollectionMembershipQuery object which can be used to query inclusion or exclusion of paths in the collection. | |
USD_API void | ComputeMembershipQuery (UsdCollectionMembershipQuery *query) const |
Populates the UsdCollectionMembershipQuery object with data from this collection, so it can be used to query inclusion or exclusion of paths. | |
USD_API bool | HasNoIncludedPaths () const |
Return true if the collection cannot possibly include anything. | |
USD_API bool | IsInRelationshipsMode () const |
Return true if this collection is relationships-mode. | |
bool | IsInExpressionMode () const |
Return true if this collection is expression-mode. | |
USD_API bool | Validate (std::string *reason) const |
Validates the collection by checking the following rules: | |
USD_API bool | ResetCollection () const |
Resets the collection by clearing both the includes and excludes targets of the collection in the current UsdEditTarget. | |
USD_API bool | BlockCollection () const |
Blocks the targets of the includes and excludes relationships of the collection, making it <* empty if "includeRoot" is false (or unset) or. | |
Collection Authoring API | |
USD_API bool | IncludePath (const SdfPath &pathToInclude) const |
Includes or adds the given path, pathToInclude in the collection. | |
USD_API bool | ExcludePath (const SdfPath &pathToExclude) const |
Excludes or removes the given path, pathToExclude from the collection. | |
Public Member Functions inherited from UsdAPISchemaBase | |
UsdAPISchemaBase (const UsdPrim &prim=UsdPrim()) | |
Construct a UsdAPISchemaBase on UsdPrim prim . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj) | |
Construct a UsdAPISchemaBase on the prim held by schemaObj . | |
virtual USD_API | ~UsdAPISchemaBase ()=0 |
Destructor. | |
Public Member Functions inherited from UsdSchemaBase | |
bool | IsConcrete () const |
Returns whether or not this class corresponds to a concrete instantiable prim type in scene description. | |
bool | IsTyped () const |
Returns whether or not this class inherits from UsdTyped. | |
bool | IsAPISchema () const |
Returns whether this is an API schema or not. | |
bool | IsAppliedAPISchema () const |
Returns whether this is an applied API schema or not. | |
bool | IsMultipleApplyAPISchema () const |
Returns whether this is an applied API schema or not. | |
UsdSchemaKind | GetSchemaKind () const |
Returns the kind of schema this class is. | |
USD_API | UsdSchemaBase (const UsdPrim &prim=UsdPrim()) |
Construct and store prim as the held prim. | |
USD_API | UsdSchemaBase (const UsdSchemaBase &otherSchema) |
Construct and store for the same prim held by otherSchema . | |
virtual USD_API | ~UsdSchemaBase () |
Destructor. | |
UsdPrim | GetPrim () const |
Return this schema object's held prim. | |
SdfPath | GetPath () const |
Shorthand for GetPrim()->GetPath(). | |
USD_API const UsdPrimDefinition * | GetSchemaClassPrimDefinition () const |
Return the prim definition associated with this schema instance if one exists, otherwise return null. | |
USD_API | operator bool () const |
Return true if this schema object is compatible with its held prim, false otherwise. | |
Static Public Member Functions | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
static USD_API TfTokenVector | GetSchemaAttributeNames (bool includeInherited, const TfToken &instanceName) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes for a given instance name. | |
static USD_API UsdCollectionAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
Return a UsdCollectionAPI holding the prim adhering to this schema at path on stage . | |
static USD_API UsdCollectionAPI | Get (const UsdPrim &prim, const TfToken &name) |
Return a UsdCollectionAPI with name name holding the prim prim . | |
static USD_API std::vector< UsdCollectionAPI > | GetAll (const UsdPrim &prim) |
Return a vector of all named instances of UsdCollectionAPI on the given prim . | |
static USD_API bool | IsSchemaPropertyBaseName (const TfToken &baseName) |
Checks if the given name baseName is the base name of a property of CollectionAPI. | |
static USD_API bool | IsCollectionAPIPath (const SdfPath &path, TfToken *name) |
Checks if the given path path is of an API schema of type CollectionAPI. | |
static USD_API bool | CanApply (const UsdPrim &prim, const TfToken &name, std::string *whyNot=nullptr) |
Returns true if this multiple-apply API schema can be applied, with the given instance name, name , to the given prim . | |
static USD_API UsdCollectionAPI | Apply (const UsdPrim &prim, const TfToken &name) |
Applies this multiple-apply API schema to the given prim along with the given instance name, name . | |
static USD_API UsdCollectionAPI | GetCollection (const UsdStagePtr &stage, const SdfPath &collectionPath) |
Returns the collection represented by the given collection path, collectionPath on the given USD stage. | |
static USD_API UsdCollectionAPI | GetCollection (const UsdPrim &prim, const TfToken &name) |
Returns the schema object representing a collection named name on the given prim . | |
static USD_API std::vector< UsdCollectionAPI > | GetAllCollections (const UsdPrim &prim) |
Returns all the named collections on the given USD prim. | |
static USD_API SdfPath | GetNamedCollectionPath (const UsdPrim &prim, const TfToken &collectionName) |
Returns the canonical path to the collection named, name on the given prim, prim . | |
static USD_API std::set< UsdObject > | ComputeIncludedObjects (const UsdCollectionMembershipQuery &query, const UsdStageWeakPtr &stage, const Usd_PrimFlagsPredicate &pred=UsdPrimDefaultPredicate) |
Returns all the usd objects that satisfy the predicate, pred in the collection represented by the UsdCollectionMembershipQuery object, query . | |
static USD_API SdfPathSet | ComputeIncludedPaths (const UsdCollectionMembershipQuery &query, const UsdStageWeakPtr &stage, const Usd_PrimFlagsPredicate &pred=UsdPrimDefaultPredicate) |
Returns all the paths that satisfy the predicate, pred in the collection represented by the UsdCollectionMembershipQuery object, query . | |
static USD_API bool | CanContainPropertyName (const TfToken &name) |
Test whether a given name contains the "collection:" prefix. | |
Static Public Member Functions inherited from UsdAPISchemaBase | |
static USD_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. | |
Static Public Member Functions inherited from UsdSchemaBase | |
static const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::MultipleApplyAPI |
Compile time constant representing what kind of schema this class is. | |
Static Public Attributes inherited from UsdAPISchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
Static Public Attributes inherited from UsdSchemaBase | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::AbstractBase |
Compile time constant representing what kind of schema this class is. | |
Protected Member Functions | |
USD_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
Protected Member Functions inherited from UsdAPISchemaBase | |
USD_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. | |
UsdAPISchemaBase (const UsdPrim &prim, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on UsdPrim prim with the specified instanceName . | |
UsdAPISchemaBase (const UsdSchemaBase &schemaObj, const TfToken &instanceName) | |
Construct a multiple-apply UsdAPISchemaBase on the prim held by schemaObj with the given instanceName . | |
const TfToken & | _GetInstanceName () const |
Returns the instance name of the API schema object belonging to a multiple-apply API schema. | |
USD_API bool | _IsCompatible () const override |
Check whether this APISchema object is valid for the currently held prim. | |
Protected Member Functions inherited from UsdSchemaBase | |
virtual UsdSchemaKind | _GetSchemaType () const |
const TfType & | _GetType () const |
USD_API UsdAttribute | _CreateAttr (TfToken const &attrName, SdfValueTypeName const &typeName, bool custom, SdfVariability variability, VtValue const &defaultValue, bool writeSparsely) const |
Friends | |
class | UsdSchemaRegistry |
Additional Inherited Members | |
Static Protected Member Functions inherited from UsdAPISchemaBase | |
static USD_API TfTokenVector | _GetMultipleApplyInstanceNames (const UsdPrim &prim, const TfType &schemaType) |
Returns a vector of names of API schema objects belonging to a multiple-apply API schema applied to a given prim. | |
A general purpose API schema used to describe a collection of prims and properties within a scene.
This API schema can be applied to a prim multiple times with different instance names to define several collections on a single prim.
A collection's membership is specified one of two ways. The first way uses the built-in relationships includes
and excludes
, and the attribute includeRoot
to determine membership. The second way is termed a pattern-based collection, and uses the built-in attribute membershipExpression
to determine membership. Here we will refer to collections using includes
, excludes
and includeRoot
as being in relationship-mode and those using the membershipExpression
as being in expression-mode.
A collection is determined to be in relationship-mode when either or both of its includes
and excludes
relationships have valid targets, or the includeRoot
attribute is set true
. In this case, the pattern-based membershipExpression
attribute is ignored. Otherwise, the collection is in expression-mode and the membershipExpression
attribute applies.
In relationship-mode the includes
and excludes
relationships specify the collection members as a set of paths to include and a set of paths to exclude. Whether or not the descendants of an included path belong to a collection is decided by its expansion rule (see below). If the collection excludes paths that are not descendent to included paths, the collection implicitly includes the root path </>
. If such a collection also includes paths that are not descendent to the excluded paths, it is considered invalid since the intent is ambiguous.
In expression-mode, the pattern-based membershipExpression
attribute is used with the expansionRule
attribute to determine collection membership. See the detailed descriptions of the built-in properties below for more details.
The built-in properties for this schema are in the collection:instanceName
namespace, where instanceName
is the user-provided applied API schema instance name.
uniform token collection:instanceName:expansionRule
- in relationship-mode, specifies how to expand the includes
and excludes
relationship targets to determine the collection's members. In expression-mode, specifies how matching scene objects against the membershipExpression
proceeds. Possible values include:
expandPrims
- in relationship-mode, all the prims descendent to the includes
relationship targets (and not descendent to excludes
relationship targets) belong to the collection. Any includes
-targeted property paths also belong to the collection. This is the default behavior. In expression-mode, the functions UsdComputeIncludedObjectsFromCollection() and UsdComputeIncludedPathsFromCollection() only test prims against the membershipExpression
to determine membership. expandPrimsAndProperties
- like expandPrims
, but in relationship-mode, all properties on all included prims also belong to the collection. In expression-mode, the functions UsdComputeIncludedObjectsFromCollection() and UsdComputeIncludedPathsFromCollection() test both prims and properties against the membershipExpression
to determine membership. explicitOnly
- in relationship-mode, only paths in the includes
relationship targets and not those in the excludes
relationship targets belong to the collection. Does not apply to expression-mode. If set in expression-mode, the functions UsdComputeIncludedObjectsFromCollection() and UsdComputeIncludedPathsFromCollection() return no results. bool collection:instanceName:includeRoot
- boolean attribute indicating whether the pseudo-root path </>
should be counted as one of the included target paths in relationship-mode. This separate attribute is required because relationships cannot directly target the root. When expansionRule
is explicitOnly
, this attribute is ignored. The fallback value is false. When set to true
, this collection is in relationship-mode. This attribute is ignored in expression-mode.
rel collection:instanceName:includes
- in relationship-mode, specifies a list of targets that are included in the collection. This can target prims or properties directly. A collection can insert the rules of another collection by making its includes
relationship target the collection:otherInstanceName
property from the collection to be included (see UsdCollectionAPI::GetCollectionAttr). Note that including another collection does not guarantee the contents of that collection will be in the final collection; instead, the rules are merged. This means, for example, an exclude entry may exclude a portion of the included collection. When a collection includes one or more collections, the order in which targets are added to the includes relationship may become significant, if there are conflicting opinions about the same path. Targets that are added later are considered to be stronger than earlier targets for the same path. This relationship is ignored in expression-mode.
rel collection:instanceName:excludes
- in relationship-mode, specifies a list of targets that are excluded below the included paths in this collection. This can target prims or properties directly, but cannot target another collection. This is to keep the membership determining logic simple, efficient and easier to reason about. Finally, it is invalid for a collection to exclude paths that are not included in it. The presence of such "orphaned" excluded paths will not affect the set of paths included in the collection, but may affect the performance of querying membership of a path in the collection (see UsdCollectionMembershipQuery::IsPathIncluded) or of enumerating the objects belonging to the collection (see UsdCollectionAPI::ComputeIncludedObjects). This relationship is ignored in expression-mode.
uniform opaque collection:instanceName
- opaque attribute (meaning it can never have a value) that represents the collection for the purpose of allowing another collection to include it in relationship-mode. When this property is targeted by another collection's includes
relationship, the rules of this collection will be inserted into the rules of the collection that includes it.
uniform pathExpression collection:instanceName:membershipExpression
- in expression-mode, defines the SdfPathExpression used to test objects for collection membership.
In some scenarios it is useful to express a collection that includes everything except certain paths. To support this, a relationship-mode collection that has an exclude that is not descendent to any include will include the root path </>
.
For any described attribute Fallback Value or Allowed Values below that are text/tokens, the actual token is published and defined in UsdTokens. So to set an attribute to the value "rightHanded", use UsdTokens->rightHanded as the value.
Definition at line 184 of file collectionAPI.h.
Definition at line 552 of file collectionAPI.h.
|
inlineexplicit |
Construct a UsdCollectionAPI on UsdPrim prim
with name name
.
Equivalent to UsdCollectionAPI::Get( prim.GetStage(), prim.GetPath().AppendProperty( "collection:name"));
for a valid prim
, but will not immediately throw an error for an invalid prim
Definition at line 201 of file collectionAPI.h.
|
inlineexplicit |
Construct a UsdCollectionAPI on the prim held by schemaObj
with name name
.
Should be preferred over UsdCollectionAPI(schemaObj.GetPrim(), name), as it preserves SchemaBase state.
Definition at line 210 of file collectionAPI.h.
|
virtual |
Destructor.
|
overrideprotectedvirtual |
Returns the kind of schema this class belongs to.
Reimplemented from UsdAPISchemaBase.
|
static |
Applies this multiple-apply API schema to the given prim
along with the given instance name, name
.
This information is stored by adding "CollectionAPI:<i>name</i>" to the token-valued, listOp metadata apiSchemas on the prim. For example, if name
is 'instance1', the token 'CollectionAPI:instance1' is added to 'apiSchemas'.
USD_API bool BlockCollection | ( | ) | const |
Blocks the targets of the includes and excludes relationships of the collection, making it <* empty if "includeRoot" is false (or unset) or.
|
static |
Returns true if this multiple-apply API schema can be applied, with the given instance name, name
, to the given prim
.
If this schema can not be a applied the prim, this returns false and, if provided, populates whyNot
with the reason it can not be applied.
Note that if CanApply returns false, that does not necessarily imply that calling Apply will fail. Callers are expected to call CanApply before calling Apply if they want to ensure that it is valid to apply a schema.
|
static |
Test whether a given name
contains the "collection:" prefix.
|
static |
Returns all the usd objects that satisfy the predicate, pred
in the collection represented by the UsdCollectionMembershipQuery object, query
.
The results depends on the load state of the UsdStage, stage
.
|
static |
Returns all the paths that satisfy the predicate, pred
in the collection represented by the UsdCollectionMembershipQuery object, query
.
The result depends on the load state of the UsdStage, stage
.
USD_API UsdCollectionMembershipQuery ComputeMembershipQuery | ( | ) | const |
Computes and returns a UsdCollectionMembershipQuery object which can be used to query inclusion or exclusion of paths in the collection.
USD_API void ComputeMembershipQuery | ( | UsdCollectionMembershipQuery * | query | ) | const |
Populates the UsdCollectionMembershipQuery object with data from this collection, so it can be used to query inclusion or exclusion of paths.
USD_API UsdAttribute CreateCollectionAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetCollectionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
USD_API UsdRelationship CreateExcludesRel | ( | ) | const |
See GetExcludesRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USD_API UsdAttribute CreateExpansionRuleAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetExpansionRuleAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
USD_API UsdAttribute CreateIncludeRootAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetIncludeRootAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
USD_API UsdRelationship CreateIncludesRel | ( | ) | const |
See GetIncludesRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USD_API UsdAttribute CreateMembershipExpressionAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetMembershipExpressionAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
USD_API bool ExcludePath | ( | const SdfPath & | pathToExclude | ) | const |
Excludes or removes the given path, pathToExclude
from the collection.
If the collection is empty, the collection becomes one that includes all paths except the givne path. Otherwise, this does nothing if the path is not included in the collection.
This does not modify the expansion-rule of the collection. Hence, if the expansionRule is expandPrims or expandPrimsAndProperties, then the descendants of pathToExclude
will also be excluded from the collection, unless explicitly included.
|
static |
Return a UsdCollectionAPI with name name
holding the prim prim
.
Shorthand for UsdCollectionAPI(prim, name);
|
static |
Return a UsdCollectionAPI holding the prim adhering to this schema at path
on stage
.
If no prim exists at path
on stage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. path
must be of the format <path>.collection:name .
This is shorthand for the following:
|
static |
Return a vector of all named instances of UsdCollectionAPI on the given prim
.
|
static |
Returns all the named collections on the given USD prim.
|
static |
Returns the schema object representing a collection named name
on the given prim
.
|
static |
Returns the collection represented by the given collection path, collectionPath
on the given USD stage.
USD_API UsdAttribute GetCollectionAttr | ( | ) | const |
This property represents the collection for the purpose of allowing another collection to include it.
When this property is targeted by another collection's includes relationship, the rules of this collection will be inserted into the rules of the collection that includes it.
Declaration | uniform opaque __INSTANCE_NAME__ |
C++ Type | SdfOpaqueValue |
Usd Type | SdfValueTypeNames->Opaque |
Variability | SdfVariabilityUniform |
USD_API SdfPath GetCollectionPath | ( | ) | const |
Returns the canonical path that represents this collection.
This points to the property named "collection:{collectionName}" on the prim defining the collection. This is the path to be used to "include" this collection in another collection.
USD_API UsdRelationship GetExcludesRel | ( | ) | const |
Specifies a list of targets that are excluded below the included paths in this collection.
This can target prims or properties directly, but cannot target another collection. This is to keep the membership determining logic simple, efficient and easier to reason about. Finally, it is invalid for a collection to exclude paths that are not included in it. The presence of such "orphaned" excluded paths will not affect the set of paths included in the collection, but may affect the performance of querying membership of a path in the collection (see UsdCollectionAPI::MembershipQuery::IsPathIncluded) or of enumerating the objects belonging to the collection (see UsdCollectionAPI::GetIncludedObjects).
USD_API UsdAttribute GetExpansionRuleAttr | ( | ) | const |
Specifies how the paths that are included in the collection must be expanded to determine its members.
Declaration | uniform token expansionRule = "expandPrims" |
C++ Type | TfToken |
Usd Type | SdfValueTypeNames->Token |
Variability | SdfVariabilityUniform |
Allowed Values | explicitOnly, expandPrims, expandPrimsAndProperties |
USD_API UsdAttribute GetIncludeRootAttr | ( | ) | const |
Boolean attribute indicating whether the pseudo-root path </>
should be counted as one of the included target paths.
The fallback is false. This separate attribute is required because relationships cannot directly target the root.
Declaration | uniform bool includeRoot |
C++ Type | bool |
Usd Type | SdfValueTypeNames->Bool |
Variability | SdfVariabilityUniform |
USD_API UsdRelationship GetIncludesRel | ( | ) | const |
Specifies a list of targets that are included in the collection.
This can target prims or properties directly. A collection can insert the rules of another collection by making its includes relationship target the collection:{collectionName} property on the owning prim of the collection to be included
USD_API UsdAttribute GetMembershipExpressionAttr | ( | ) | const |
Specifies a path expression that determines membership in this collection.
Declaration | uniform pathExpression membershipExpression |
C++ Type | SdfPathExpression |
Usd Type | SdfValueTypeNames->PathExpression |
Variability | SdfVariabilityUniform |
|
inline |
Returns the name of this multiple-apply schema instance.
Definition at line 236 of file collectionAPI.h.
|
static |
Returns the canonical path to the collection named, name
on the given prim, prim
.
|
static |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes for a given instance name.
Does not include attributes that may be authored by custom/extended methods of the schemas involved. The names returned will have the proper namespace prefix.
|
static |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended methods of the schemas involved.
USD_API bool HasNoIncludedPaths | ( | ) | const |
Return true if the collection cannot possibly include anything.
For collections in relationships-mode, this is the case if the includes relationship has no target paths, and the includeRoot attribute is false.
For collections in expression-mode, this is the case if the membershipExpression attribute has either no opinion or if it is SdfPathExpression::Nothing().
Note that there may be cases where the collection includes no objects despite HasNoIncludedPaths() returning false. For example, if the included objects are unloaded, or if the included objects are also excluded, or if an authored non-empty membershipExpression happens not to match any objects on the stage.
USD_API bool IncludePath | ( | const SdfPath & | pathToInclude | ) | const |
Includes or adds the given path, pathToInclude
in the collection.
This does nothing if the path is already included in the collection.
This does not modify the expansion-rule of the collection. Hence, if the expansionRule is expandPrims or expandPrimsAndProperties, then the descendants of pathToInclude
will be also included in the collection unless explicitly excluded.
Checks if the given path path
is of an API schema of type CollectionAPI.
If so, it stores the instance name of the schema in name
and returns true. Otherwise, it returns false.
|
inline |
Return true if this collection is expression-mode.
That is, if it uses the membershipExpression
attribute to determine membership and not the includes
and excludes
relationships. Equivalent to !IsInRelationshipsMode()
.
Definition at line 595 of file collectionAPI.h.
USD_API bool IsInRelationshipsMode | ( | ) | const |
Return true if this collection is relationships-mode.
That is, if it uses the includes
and excludes
relationships to determine membership and not the membershipExpression
attribute. This is the case when either or both of its includes
and excludes
relationships have valid targets, or the includeRoot
attribute is set true
. This is equivalent to !IsInExpressionMode()
.
|
static |
Checks if the given name baseName
is the base name of a property of CollectionAPI.
USD_API bool ResetCollection | ( | ) | const |
Resets the collection by clearing both the includes and excludes targets of the collection in the current UsdEditTarget.
USD_API SdfPathExpression ResolveCompleteMembershipExpression | ( | ) | const |
Obtain a complete SdfPathExpression from this collection's membershipExpression.
First, UsdAttribute::Get() the value of GetMembershipExpressionAttr(), then resolve any contained references. Replace any remaining "weaker" references (_) with SdfPathExpression::Nothing(). Replace other references by recursively resolving the expressions from the collections on the referenced prims. If no such prims or no such collections exist, replace those references with SdfPathExpression::Nothing() as well.
USD_API bool Validate | ( | std::string * | reason | ) | const |
Validates the collection by checking the following rules:
|
friend |
Definition at line 336 of file collectionAPI.h.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 190 of file collectionAPI.h.