Loading...
Searching...
No Matches
UsdImaging Collection Predicate API

Predicate functions mirroring UsdGetCollectionPredicateLibrary for use in path expressions evaluated on prims in a Hydra scene index populated from a USD stage. More...

Functions

USDIMAGING_API const HdCollectionPredicateLibraryUsdImagingGetCollectionPredicateLibrary ()
 Return a predicate library containing only the USD predicate functions listed above.
 
USDIMAGING_API HdCollectionPredicateLibrary UsdImagingGetCollectionPredicateLibrary (const HdCollectionPredicateLibrary &base)
 Return a new predicate library that extends base with the USD predicate functions listed above.
 

Detailed Description

Predicate functions mirroring UsdGetCollectionPredicateLibrary for use in path expressions evaluated on prims in a Hydra scene index populated from a USD stage.

The functions UsdImagingGetCollectionPredicateLibrary provide the following predicate functions. All predicates read from the __usdPrimInfo data source (UsdImagingUsdPrimInfoSchema) stored on each scene index prim, and mirror the semantics of the corresponding functions in UsdCollectionPredicateLibrary.

Usage Examples

"/World//{kind:component}" matches all descendant prims of /World that have kind "component" (or a registered sub-kind).

"//{defined}" matches all scene index prims with specifier "def".

"//{model}" matches all scene index prims whose kind is in the model hierarchy.

"//{isa:Mesh}" matches all scene index prims whose USD type is Mesh.

"//{hasAPI:GeomModelAPI}" matches all scene index prims that have the GeomModelAPI applied.

"//{variant(shadingVariant=default)}" matches all scene index prims that have the variant set "shadingVariant" selected to "default".

Function Documentation

◆ UsdImagingGetCollectionPredicateLibrary() [1/2]

USDIMAGING_API const HdCollectionPredicateLibrary & UsdImagingGetCollectionPredicateLibrary ( )

Return a predicate library containing only the USD predicate functions listed above.

Note
The library does not include the core Hydra predicate functions. Use the overload below if that is desired.

◆ UsdImagingGetCollectionPredicateLibrary() [2/2]

USDIMAGING_API HdCollectionPredicateLibrary UsdImagingGetCollectionPredicateLibrary ( const HdCollectionPredicateLibrary & base)

Return a new predicate library that extends base with the USD predicate functions listed above.

A typical use is to compose the USD predicates on top of the core Hydra predicates so that a single evaluator can match both kinds of expression:

sceneIndex,
expr,
Evaluates SdfPathExpressions with prims from a given HdSceneIndex.
HD_API const HdCollectionPredicateLibrary & HdGetCollectionPredicateLibrary()
Return a predicate library with a foundational set of predicate functions to evaluate SdfPathExpressi...
USDIMAGING_API const HdCollectionPredicateLibrary & UsdImagingGetCollectionPredicateLibrary()
Return a predicate library containing only the USD predicate functions listed above.

The returned library is a value; callers that call this frequently with the same base should cache the result themselves.

See also
HdGetCollectionPredicateLibrary
HdCollectionExpressionEvaluator