2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Authors
|
2023-08-06 18:57:56 +10:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2023-08-04 15:10:48 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <pxr/imaging/hd/sceneDelegate.h>
|
|
|
|
|
|
2024-02-05 19:37:57 +01:00
|
|
|
#include "object.hh"
|
2023-08-04 15:10:48 +02:00
|
|
|
|
|
|
|
|
namespace blender::io::hydra {
|
|
|
|
|
|
|
|
|
|
class VolumeData : public ObjectData {
|
|
|
|
|
protected:
|
|
|
|
|
std::string filepath_;
|
|
|
|
|
pxr::HdVolumeFieldDescriptorVector field_descriptors_;
|
|
|
|
|
MaterialData *mat_data_ = nullptr;
|
|
|
|
|
|
|
|
|
|
public:
|
2023-08-04 13:35:21 -04:00
|
|
|
VolumeData(HydraSceneDelegate *scene_delegate,
|
|
|
|
|
const Object *object,
|
|
|
|
|
pxr::SdfPath const &prim_id);
|
2023-08-04 15:10:48 +02:00
|
|
|
|
|
|
|
|
void init() override;
|
|
|
|
|
void insert() override;
|
|
|
|
|
void remove() override;
|
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
|
|
pxr::VtValue get_data(pxr::TfToken const &key) const override;
|
|
|
|
|
pxr::VtValue get_data(pxr::SdfPath const &id, pxr::TfToken const &key) const override;
|
|
|
|
|
pxr::SdfPath material_id() const override;
|
|
|
|
|
void available_materials(Set<pxr::SdfPath> &paths) const override;
|
|
|
|
|
|
|
|
|
|
pxr::HdVolumeFieldDescriptorVector field_descriptors() const;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void write_materials() override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace blender::io::hydra
|