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)...
This commit is contained in:
2018-11-27 20:10:41 +01:00
parent 22e6ae11b4
commit 2a578b37b3
13 changed files with 51 additions and 63 deletions

View File

@@ -107,9 +107,10 @@ static void deformVerts(
lattice_deform_verts(lmd->object, ctx->object, mesh_src,
vertexCos, numVerts, lmd->name, lmd->strength);
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}}
}
}
static void deformVertsEM(
ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *em,
@@ -119,7 +120,7 @@ static void deformVertsEM(
deformVerts(md, ctx, mesh_src, vertexCos, numVerts);
if (mesh_src != mesh) {
if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}