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>2019-02-11 22:20:12 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-02-11 22:24:07 +0300
commit7cca0f9998a3d12e0046009c643038c9faa45767 (patch)
tree2178763ed908b018c29408268a612559fab8ad34 /source/blender/modifiers/intern/MOD_surfacedeform.c
parentd8888b2f48bc3146eeb490de4544fadd5fc37386 (diff)
Fix T61391: MeshDeform Modifier does not work on a solidified planar mesh.
`BKE_modifier_get_evaluated_mesh_from_evaluated_object()` used by modifiers needing access to other objects' geometry probably skipped out of the radar when cage and final evaluated meshes were added to BMEditMesh? In any case, we do not need to duplicate (and then free!) a temp mesh from editdata anymore, and we can even add instead a parameter to get cage instead of final. Also makes modifiers code a bit simpler.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_surfacedeform.c')
-rw-r--r--source/blender/modifiers/intern/MOD_surfacedeform.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c
index cb04d7fc307..d3910a04dfb 100644
--- a/source/blender/modifiers/intern/MOD_surfacedeform.c
+++ b/source/blender/modifiers/intern/MOD_surfacedeform.c
@@ -1124,7 +1124,6 @@ static void surfacedeformModifier_do(
float (*vertexCos)[3], unsigned int numverts, Object *ob)
{
SurfaceDeformModifierData *smd = (SurfaceDeformModifierData *)md;
- bool free_target;
Mesh *target;
unsigned int tnumverts, tnumpoly;
@@ -1145,7 +1144,7 @@ static void surfacedeformModifier_do(
}
Object *ob_target = DEG_get_evaluated_object(ctx->depsgraph, smd->target);
- target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, &free_target);
+ target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false);
#if 0 /* Should not be needed anymore since we always get that mesh from eval object ? */
if (target == NULL && smd->verts == NULL && ob == DEG_get_original_object(ob)) {
/* Special case, binding happens outside of depsgraph evaluation, so we can build our own
@@ -1169,7 +1168,7 @@ static void surfacedeformModifier_do(
if (ob != DEG_get_original_object(ob)) {
BLI_assert(!"Trying to bind inside of depsgraph evaluation");
modifier_setError(md, "Trying to bind inside of depsgraph evaluation");
- goto finally;
+ return;
}
float tmp_mat[4][4];
@@ -1180,17 +1179,17 @@ static void surfacedeformModifier_do(
smd->flags &= ~MOD_SDEF_BIND;
}
/* Early abort, this is binding 'call', no need to perform whole evaluation. */
- goto finally;
+ return;
}
/* Poly count checks */
if (smd->numverts != numverts) {
modifier_setError(md, "Verts changed from %u to %u", smd->numverts, numverts);
- goto finally;
+ return;
}
else if (smd->numpoly != tnumpoly) {
modifier_setError(md, "Target polygons changed from %u to %u", smd->numpoly, tnumpoly);
- goto finally;
+ return;
}
/* Actual vertex location update starts here */
@@ -1217,11 +1216,6 @@ static void surfacedeformModifier_do(
MEM_freeN(data.targetCos);
}
-
-finally:
- if (target != NULL && free_target) {
- BKE_id_free(NULL, target);
- }
}
static void deformVerts(