usdrt::RtPrimSelection
Defined in usdrt/scenegraph/usd/rt/primSelection.h
-
class RtPrimSelection
The RtPrimSelection class represents a subset of a stage’s prims, and allows you to efficiently process them on CPU or GPU using the fabric::batch API.
It provides:
a batch::View from which you can construct a batch::ViewIterator to iterate over the data on CPU or GPU.
a method to convert attribute names and types to AttributeRefs, which you need to get attributes from the batch::ViewIterator.
a method to get the number of prims in the view without creating a batch::ViewIterator. When processing prims on GPU you typically use the CPU to spawn a set of GPU threads, for example one thread per prim. This method allows you to do this without the expense of creating a batch::ViewIterator on both CPU and GPU.
To create an RtPrimSelection, use UsdStage::GetDataView(), which allows you to specify which of the stage’s prims you want to include in the view.
Public Functions
-
inline AttributeRef GetRef(SdfValueTypeName type, const TfToken &name) const
Convert an attribute name and type to an AttributeRef, which you need to get attributes from the batch::ViewIterator.
-
inline omni::fabric::batch::View GetBatchView() const
Get a batch::View that represents this view. From this you can construct a batch::ViewIterator to iterate over the data on CPU or GPU.
-
inline size_t GetCount() const
Get the number of prims in the view without creating a batch::ViewIterator. When processing prims on GPU you typically use the CPU to spawn a set of GPU threads, for example one thread per prim. This method allows you to do this without the expense of creating a batch::ViewIterator on both CPU and GPU.