Fix #112448: Leading deform modifiers skip adding original coordinates

Previously the first group of deform modifiers didn't need to access
original coordinates explicitly because the deformation wasn't included
in the mesh positions. After d20f992322 the mesh is deformed
directly though, so the original coordinates need to be added first.

In the case of this report, the particle system (which is a "deform"
modifier for reasons) didn't have original coordinates to work with, so
it created the child particles at the deformed positions from the shape
keys every time. Though for some reason it only did that for renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/113679
This commit is contained in:
Hans Goudey 2023-10-13 20:35:16 +02:00
parent bd4c310a19
commit d7e501ce3b
1 changed files with 9 additions and 0 deletions

View File

@ -707,6 +707,15 @@ static void mesh_calc_modifiers(Depsgraph *depsgraph,
mesh_final = BKE_mesh_copy_for_eval(mesh_input);
ASSERT_IS_VALID_MESH(mesh_final);
}
if (mti->required_data_mask) {
CustomData_MeshMasks mask{};
mti->required_data_mask(md, &mask);
if (mask.vmask & CD_MASK_ORCO) {
add_orco_mesh(ob, nullptr, mesh_final, nullptr, CD_ORCO);
}
}
BKE_modifier_deform_verts(
md,
&mectx,