Modifiers: Correct deform-only modifiers

There was a discontinuity between how deform-only modifiers are applied
for the case when result deform mesh is requested and when it is not.

Namely, the input mesh will always be guaranteed to present in the
former case, but not in the latter.

This change makes it so input mesh to deform-only modifiers is always
at consistent state.

Pair programming and review together with Bastien, thanks!
This commit is contained in:
Sergey Sharybin 2019-11-13 11:24:16 +01:00
parent c73a99ef90
commit 5fde907fd3
1 changed files with 4 additions and 4 deletions

View File

@ -1101,12 +1101,12 @@ static void mesh_calc_modifiers(struct Depsgraph *depsgraph,
/* if this is not the last modifier in the stack then recalculate the normals
* to avoid giving bogus normals to the next modifier see: [#23673] */
else if (isPrevDeform && mti->dependsOnNormals && mti->dependsOnNormals(md)) {
/* XXX, this covers bug #23673, but we may need normal calc for other types */
if (mesh_final) {
BKE_mesh_vert_coords_apply(mesh_final, deformed_verts);
if (mesh_final == NULL) {
mesh_final = BKE_mesh_copy_for_eval(mesh_input, true);
ASSERT_IS_VALID_MESH(mesh_final);
}
BKE_mesh_vert_coords_apply(mesh_final, deformed_verts);
}
modwrap_deformVerts(md, &mectx, mesh_final, deformed_verts, num_deformed_verts);
}
else {