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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user