diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-13 13:24:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-11-13 13:29:00 +0300 |
commit | 5fde907fd3eae07d01ea28003a723f704da817b4 (patch) | |
tree | 125c3ed570dd8a5b342f77f14959b1bffc61a2af /source/blender/blenkernel/intern/DerivedMesh.c | |
parent | c73a99ef902b21cc0ed2b03daffa9f1adfb70412 (diff) |
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!
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 2f61cfcbc15..d61c498b71f 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -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 { |