12#include <pxr/imaging/hd/volumeFieldBindingSchema.h>
29 bits |= HdChangeTracker::DirtyVolumeField;
33void HdCyclesVolume::Populate(HdSceneDelegate *sceneDelegate, HdDirtyBits dirtyBits,
bool &rebuild)
38 _geom->set_object_space(
true);
40 if (dirtyBits & HdChangeTracker::DirtyVolumeField) {
41 const HdSceneIndexPrim prim =
GetPrim(sceneDelegate, GetId());
42 HdVolumeFieldBindingSchema bindings = HdVolumeFieldBindingSchema::GetFromParent(
45 for (
const TfToken &fieldName : bindings.GetVolumeFieldBindingNames()) {
46 auto pathDs = bindings.GetVolumeFieldBinding(fieldName);
50 const SdfPath fieldId = pathDs->GetTypedValue(0.0f);
52 if (
auto *
const openvdbAsset =
static_cast<HdCyclesField *
>(
53 sceneDelegate->GetRenderIndex().GetBprim(_tokens->openvdbAsset, fieldId)))
55 const ustring name(fieldName.GetString());
61 _geom->need_attribute(scene, name))
64 _geom->attributes.add(std) :
71 _geom->merge_grids(scene);
ImageHandle & data_voxel_for_write()
static AttributeStandard name_volume_standard(ustring name)
HdCyclesGeometry(const PXR_NS::SdfPath &rprimId)
PXR_NS::HdDirtyBits GetInitialDirtyBitsMask() const override
PXR_NS::HdDirtyBits GetInitialDirtyBitsMask() const override
HdCyclesVolume(const PXR_NS::SdfPath &rprimId)
~HdCyclesVolume() override
#define HDCYCLES_NAMESPACE_CLOSE_SCOPE
TF_DEFINE_PRIVATE_TOKENS(_tokens,(visibleInPrimaryRay)(treatAsPoint)(falloff))
HDCYCLES_NAMESPACE_OPEN_SCOPE HdSceneIndexPrim GetPrim(HdSceneDelegate *delegate, const SdfPath &id)