Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-11-27 22:10:41 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-27 23:17:06 +0300
commit2a578b37b3144ab4df7c605a95fabb699799b0dd (patch)
tree1ce3b6e0db47d9cd8457bb9681a9eb5c71558c3c /source/blender/modifiers/intern/MOD_laplaciandeform.c
parent22e6ae11b46cb73640c3f48f7e5353d57d3e040b (diff)
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)...
Diffstat (limited to 'source/blender/modifiers/intern/MOD_laplaciandeform.c')
-rw-r--r--source/blender/modifiers/intern/MOD_laplaciandeform.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c
index 39085cc4588..ba45e6bf848 100644
--- a/source/blender/modifiers/intern/MOD_laplaciandeform.c
+++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c
@@ -737,7 +737,8 @@ static void deformVerts(
Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, mesh_src, vertexCos, numVerts);
- if (mesh_src != mesh) {
+
+ if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}
@@ -747,9 +748,11 @@ static void deformVertsEM(
Mesh *mesh, float (*vertexCos)[3], int numVerts)
{
Mesh *mesh_src = MOD_deform_mesh_eval_get(ctx->object, editData, mesh, NULL, numVerts, false, false);
+
LaplacianDeformModifier_do((LaplacianDeformModifierData *)md, ctx->object, mesh_src,
vertexCos, numVerts);
- if (mesh_src != mesh) {
+
+ if (!ELEM(mesh_src, NULL, mesh)) {
BKE_id_free(NULL, mesh_src);
}
}