[Bf-blender-cvs] [02a204fe67e] master: Fix T68024: Crash from missing original-index mesh layer

Campbell Barton noreply at git.blender.org
Wed Sep 23 07:28:01 CEST 2020


Commit: 02a204fe67eeefbe9c1485e109a21c786645585b
Author: Campbell Barton
Date:   Wed Sep 23 15:12:28 2020 +1000
Branches: master
https://developer.blender.org/rB02a204fe67eeefbe9c1485e109a21c786645585b

Fix T68024: Crash from missing original-index mesh layer

Constructive modifiers were not initializing an original index layer
in the case a previous deform modifier created 'mesh_final'.

This happened in the case of multiple deform modifiers that deform along
normals, as requesting normals caused the final mesh to be created.

Ensure mapping data is created in the case
only non-constructive modifiers have run.

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

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

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

diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 2f910f66cce..ecc0413b8cc 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1104,7 +1104,11 @@ static void mesh_calc_modifiers(struct Depsgraph *depsgraph,
       bool check_for_needs_mapping = false;
       /* apply vertex coordinates or build a Mesh as necessary */
       if (mesh_final != NULL) {
-        /* pass */
+        if (have_non_onlydeform_modifiers_appled == false) {
+          /* If we only deformed, we won't have initialized #CD_ORIGINDEX.
+           * as this is the only part of the function that initializes mapping. */
+          check_for_needs_mapping = true;
+        }
       }
       else {
         mesh_final = BKE_mesh_copy_for_eval(mesh_input, true);



More information about the Bf-blender-cvs mailing list