![]() |
|
Functions for use in path expressions that are evaluated on prims in a scene index. More...
Functions | |
| HD_API const HdCollectionPredicateLibrary & | HdGetCollectionPredicateLibrary () |
| Return a predicate library with a foundational set of predicate functions to evaluate SdfPathExpressions on prims in a scene index. | |
Functions for use in path expressions that are evaluated on prims in a scene index.
The library returned by HdGetCollectionPredicateLibrary provides the following predicate functions:
hdType(string primType) Returns true if the scene index prim's type is primType.hdVisible(bool visibility = true) Returns true if the scene index prim's visibility is visibility.hdPurpose(string purpose) Returns true if the scene index prim's purpose is purpose.hdHasDataSource(string locatorStr) Returns true if the scene index prim's container has a valid data source at data source locator locatorStr. Multiple locator tokens may be provided by using '.' as the delimiter. e.g. "primvars.foo". A locator token may contain a namespace prefix. e.g. "primvars.ri:baz" is parsed as two tokens, "primvars" and "ri:baz".hdHasPrimvar(string primvarName) Returns true if the scene index prim has a primvar named primvarName.hdHasMaterialBinding(string materialPath) Returns true if the scene index prim's resolved (allPurpose) material binding path contains the substring materialPath.type visible purpose hasDataSOurce hasPrimvar hasMaterialBinding Any predicate functions in hd will use the 'hd' prefix henceforth to make it clear to the author/reader that it is a (core) hydra predicate.
This section provides usage examples for the Hydra Collection Predicate API.
"/World//{hdType:basisCurves}" matches all descendant prims of /World that are basis curves.
"//{hdVisible:false}" matches all scene index prims that are invisible.
"//{hdPurpose:guide}" matches all scene index prims whose purpose is 'guide'.
"//Foo/{hdHasDataSource:"bar.baz"}" matches children of any prim named Foo that have a valid data source at bar.baz .
"/Foo//{hdHasPrimvar:baz}" matches all descendant prims of Foo that have a primvar named "baz".
"//{hdHasMaterialBinding:"GlossyMat"}" matches all scene index prims whose resolved (allPurpose) material binding path contains the string "GlossyMat".
| HD_API const HdCollectionPredicateLibrary & HdGetCollectionPredicateLibrary | ( | ) |
Return a predicate library with a foundational set of predicate functions to evaluate SdfPathExpressions on prims in a scene index.
To evaluate the path expression, an evaluator object is constructed with the predicate library as an argument.