diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-23 08:09:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-23 08:26:01 +0300 |
commit | ea5c8c4e844f29772f9b4381ead04b0be68df30d (patch) | |
tree | 139efe2d72d514284104e2236fce8f330493b350 | |
parent | 5a28090977d66d8e52d269fb5bb938d953191dde (diff) |
Cleanup: re-order constructive modifier checks
Minor changes to simplify fix (coming next), no functional changes.
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index bfdc8ad37e5..2f910f66cce 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1101,31 +1101,27 @@ static void mesh_calc_modifiers(struct Depsgraph *depsgraph, BKE_modifier_deform_verts(md, &mectx, mesh_final, deformed_verts, num_deformed_verts); } else { - have_non_onlydeform_modifiers_appled = true; - - /* determine which data layers are needed by following modifiers */ - CustomData_MeshMasks nextmask; - if (md_datamask->next) { - nextmask = md_datamask->next->mask; - } - else { - nextmask = final_datamask; - } - + bool check_for_needs_mapping = false; /* apply vertex coordinates or build a Mesh as necessary */ - if (mesh_final) { - if (deformed_verts) { - BKE_mesh_vert_coords_apply(mesh_final, deformed_verts); - } + if (mesh_final != NULL) { + /* pass */ } else { mesh_final = BKE_mesh_copy_for_eval(mesh_input, true); ASSERT_IS_VALID_MESH(mesh_final); + check_for_needs_mapping = true; + } - if (deformed_verts) { - BKE_mesh_vert_coords_apply(mesh_final, deformed_verts); - } + if (deformed_verts) { + BKE_mesh_vert_coords_apply(mesh_final, deformed_verts); + } + + have_non_onlydeform_modifiers_appled = true; + + /* determine which data layers are needed by following modifiers */ + CustomData_MeshMasks nextmask = md_datamask->next ? md_datamask->next->mask : final_datamask; + if (check_for_needs_mapping) { /* Initialize original indices the first time we evaluate a * constructive modifier. Modifiers will then do mapping mostly * automatic by copying them through CustomData_copy_data along |