[Bf-blender-cvs] [5fde907fd3e] blender-v2.81-release: Modifiers: Correct deform-only modifiers

Sergey Sharybin noreply at git.blender.org
Wed Nov 13 11:37:39 CET 2019


Commit: 5fde907fd3eae07d01ea28003a723f704da817b4
Author: Sergey Sharybin
Date:   Wed Nov 13 11:24:16 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB5fde907fd3eae07d01ea28003a723f704da817b4

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!

===================================================================

M	source/blender/blenkernel/intern/DerivedMesh.c

===================================================================

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 {



More information about the Bf-blender-cvs mailing list