From 2a578b37b3144ab4df7c605a95fabb699799b0dd Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 27 Nov 2018 20:10:41 +0100 Subject: Modifiers: cleanup/harmonize deform modifiers code re. mesh source. Also fixes a few issues (like meshdeform's EM variant not using editmesh data), and adds a few optimizations (like only generating that source mesh when we do have a vgroup defined in parameters, for modifiers only using it to access vgroup)... --- source/blender/modifiers/intern/MOD_wave.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_wave.c') diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 9f864063c7b..0849b268f7f 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -314,8 +314,9 @@ static void deformVerts( waveModifier_do(wmd, ctx->depsgraph, ctx->object, mesh_src, vertexCos, numVerts); - if (mesh_src != mesh) + if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); + } } static void deformVertsEM( @@ -333,8 +334,9 @@ static void deformVertsEM( waveModifier_do(wmd, ctx->depsgraph, ctx->object, mesh_src, vertexCos, numVerts); - if (mesh_src != mesh) + if (!ELEM(mesh_src, NULL, mesh)) { BKE_id_free(NULL, mesh_src); + } } -- cgit v1.2.3