Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-06-14 13:44:13 +0300
committerJacques Lucke <jacques@blender.org>2021-06-14 13:44:13 +0300
commitdddcf1e9bbf4a6d1f4ff03eaf0cb7e9228b18ec5 (patch)
treec20defa7efd54c933d20a296abefe567909bb6c0 /source/blender/modifiers/intern/MOD_mesh_to_volume.cc
parent3b162b7c185d089e93d892169a458d552196b7b6 (diff)
parentc9dc55301cd7903b7ef7c045d337ada29aa809a1 (diff)
Merge branch 'master' into temp-compact-node-prototypetemp-compact-node-prototype
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mesh_to_volume.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_mesh_to_volume.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
index cc007651733..778b5746471 100644
--- a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
+++ b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
@@ -20,6 +20,7 @@
#include <vector>
+#include "BKE_geometry_set.hh"
#include "BKE_lib_query.h"
#include "BKE_mesh_runtime.h"
#include "BKE_mesh_wrapper.h"
@@ -204,7 +205,9 @@ static float compute_voxel_size(const ModifierEvalContext *ctx,
}
#endif
-static Volume *modifyVolume(ModifierData *md, const ModifierEvalContext *ctx, Volume *input_volume)
+static Volume *mesh_to_volume(ModifierData *md,
+ const ModifierEvalContext *ctx,
+ Volume *input_volume)
{
#ifdef WITH_OPENVDB
using namespace blender;
@@ -278,6 +281,17 @@ static Volume *modifyVolume(ModifierData *md, const ModifierEvalContext *ctx, Vo
#endif
}
+static void modifyGeometrySet(ModifierData *md,
+ const ModifierEvalContext *ctx,
+ GeometrySet *geometry_set)
+{
+ Volume *input_volume = geometry_set->get_volume_for_write();
+ Volume *result_volume = mesh_to_volume(md, ctx, input_volume);
+ if (result_volume != input_volume) {
+ geometry_set->replace_volume(result_volume);
+ }
+}
+
ModifierTypeInfo modifierType_MeshToVolume = {
/* name */ "Mesh to Volume",
/* structName */ "MeshToVolumeModifierData",
@@ -295,8 +309,7 @@ ModifierTypeInfo modifierType_MeshToVolume = {
/* deformMatricesEM */ nullptr,
/* modifyMesh */ nullptr,
/* modifyHair */ nullptr,
- /* modifyGeometrySet */ nullptr,
- /* modifyVolume */ modifyVolume,
+ /* modifyGeometrySet */ modifyGeometrySet,
/* initData */ initData,
/* requiredDataMask */ nullptr,