diff --git a/modifiers/godot/voxel_modifier_gd.cpp b/modifiers/godot/voxel_modifier_gd.cpp index 375666c18..213208a2b 100644 --- a/modifiers/godot/voxel_modifier_gd.cpp +++ b/modifiers/godot/voxel_modifier_gd.cpp @@ -133,15 +133,15 @@ void VoxelModifier::_notification(int p_what) { const AABB prev_aabb = modifier->get_aabb(); Transform3D terrain_local = _volume->get_global_transform().affine_inverse() * get_global_transform(); + // If the terrain moved, the modifiers do not need to be updated. + if (terrain_local == modifier->get_transform()) { + break; + } + WARN_PRINT("MODIFIER WAS UPDATED"); modifier->set_transform(terrain_local); const AABB aabb = modifier->get_aabb(); post_edit_modifier(*_volume, prev_aabb); post_edit_modifier(*_volume, aabb); - - // TODO Handle nesting properly, though it's a pain in the ass - // When the terrain is moved, the local transform of modifiers technically changes too. - // However it did not change relative to the terrain. But because we don't have a way to check that, - // all modifiers will trigger updates at the same time... } } break; }