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:
authorBrecht Van Lommel <brecht@blender.org>2020-10-05 12:20:59 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-10-05 12:20:59 +0300
commit0026ca09defb26b4137ac66a94d1ba757239aa32 (patch)
tree20aa7884efafc83a62607ac924610b33e4133e85
parenta4f8b2ad7653cac8a5f7821ce7ee9af44b13a758 (diff)
Revert "Volumes: make Mesh to Volume modifier independent of object transforms"
This reverts commit 66cd82a8d. This was based on a misunderstanding. We do want to take into account transforms similar to other modifiers like booleans, to support taking into account animated transforms, combining multiple meshes into one volume, etc.
-rw-r--r--source/blender/modifiers/intern/MOD_mesh_to_volume.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
index 2d6791cbe68..6fdc78c6ce9 100644
--- a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
+++ b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
@@ -120,6 +120,7 @@ static void initData(ModifierData *md)
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
MeshToVolumeModifierData *mvmd = reinterpret_cast<MeshToVolumeModifierData *>(md);
+ DEG_add_modifier_to_transform_relation(ctx->node, "Mesh to Volume Modifier");
if (mvmd->object) {
DEG_add_object_relation(
ctx->node, mvmd->object, DEG_OB_COMP_GEOMETRY, "Mesh to Volume Modifier");
@@ -197,9 +198,7 @@ static float compute_voxel_size(const MeshToVolumeModifierData *mvmd,
return voxel_size;
}
-static Volume *modifyVolume(ModifierData *md,
- const ModifierEvalContext *UNUSED(ctx),
- Volume *input_volume)
+static Volume *modifyVolume(ModifierData *md, const ModifierEvalContext *ctx, Volume *input_volume)
{
#ifdef WITH_OPENVDB
using namespace blender;
@@ -216,7 +215,8 @@ static Volume *modifyVolume(ModifierData *md,
}
BKE_mesh_wrapper_ensure_mdata(mesh);
- const float4x4 mesh_to_own_object_space_transform = object_to_convert->obmat;
+ const float4x4 mesh_to_own_object_space_transform = float4x4(ctx->object->imat) *
+ float4x4(object_to_convert->obmat);
const float voxel_size = compute_voxel_size(mvmd, mesh_to_own_object_space_transform);
float4x4 mesh_to_index_space_transform;
@@ -263,7 +263,7 @@ static Volume *modifyVolume(ModifierData *md,
return volume;
#else
- UNUSED_VARS(md);
+ UNUSED_VARS(md, ctx);
UNUSED_VARS(compute_voxel_size);
BKE_modifier_set_error(md, "Compiled without OpenVDB");
return input_volume;