forked from blender/blender
Export volumes from object modifier (quick effect) #62
@ -25,16 +25,16 @@ std::unique_ptr<ObjectData> ObjectData::create(BlenderSceneDelegate *scene_deleg
|
||||
{
|
||||
std::unique_ptr<ObjectData> obj_data;
|
||||
|
||||
if (VolumeModifierData::is_volume_modifier(object)) {
|
||||
return std::make_unique<VolumeModifierData>(scene_delegate, object, prim_id);
|
||||
}
|
||||
|
||||
switch (object->type) {
|
||||
case OB_MESH:
|
||||
DagerD marked this conversation as resolved
Outdated
|
||||
case OB_SURF:
|
||||
case OB_FONT:
|
||||
case OB_CURVES_LEGACY:
|
||||
case OB_MBALL:
|
||||
if (VolumeModifierData::is_volume_modifier(object)) {
|
||||
obj_data = std::make_unique<VolumeModifierData>(scene_delegate, object, prim_id);
|
||||
break;
|
||||
}
|
||||
obj_data = std::make_unique<MeshData>(scene_delegate, object, prim_id);
|
||||
break;
|
||||
case OB_CURVES:
|
||||
|
@ -29,7 +29,6 @@ class VolumeData : public ObjectData {
|
||||
protected:
|
||||
void write_materials() override;
|
||||
|
||||
private:
|
||||
std::string filepath_;
|
||||
pxr::HdVolumeFieldDescriptorVector field_descriptors_;
|
||||
MaterialData *mat_data_ = nullptr;
|
||||
|
@ -120,7 +120,8 @@ std::string VolumeModifierData::get_cached_file_path(std::string directory, int
|
||||
{
|
||||
char file_path[FILE_MAX];
|
||||
char file_name[32];
|
||||
strcat(strcat(strcpy(file_name, FLUID_NAME_DATA), "_####"), FLUID_DOMAIN_EXTENSION_OPENVDB);
|
||||
snprintf(
|
||||
file_name, sizeof(file_name), "%s_####%s", FLUID_NAME_DATA, FLUID_DOMAIN_EXTENSION_OPENVDB);
|
||||
BLI_path_frame(file_name, sizeof(file_name), frame, 0);
|
||||
BLI_path_join(file_path, sizeof(file_path), directory.c_str(), FLUID_DOMAIN_DIR_DATA, file_name);
|
||||
|
||||
|
@ -20,9 +20,10 @@ class VolumeModifierData : public VolumeData {
|
||||
void init() override;
|
||||
void update() override;
|
||||
|
||||
private:
|
||||
protected:
|
||||
void write_transform() override;
|
||||
|
||||
private:
|
||||
std::string get_cached_file_path(std::string directory, int frame);
|
||||
|
||||
FluidModifierData *modifier_;
|
||||
|
Loading…
Reference in New Issue
Block a user
Propose to create
class VolumeModifierData::public VolumeData
and separate logic in these two classes