diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-30 12:34:08 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-30 13:04:06 +0300 |
commit | 72f4ac99c70b02e095cc9a71d501d6b1dc85ac3e (patch) | |
tree | 940c598d4efb2246eb7b523840e2b7337a59bc1b /source/blender/modifiers/intern/MOD_weightvgproximity.c | |
parent | e55c1a9b5a089f3c688a0b47cba363cb0d6f92d0 (diff) |
Cleanup/fix wrong modifiers targets handling in COW context.
Modifiers stack only get COW/evaluated IDs, so no need to go auery again
DEG for those. Further more, now unified handling of EditBMesh case (was
done on case-by-case basis in a few modifiers, not all for some reason).
We are still missing the ability to get final and cage deformed meshes
when in Edit mode though, this is to be defined/implemented in depsgraph.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgproximity.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgproximity.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 9e77e0d3794..4549e60a8d8 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -506,7 +506,8 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes const bool use_trgt_faces = (wmd->proximity_flags & MOD_WVG_PROXIMITY_GEOM_FACES) != 0; if (use_trgt_verts || use_trgt_edges || use_trgt_faces) { - Mesh *target_mesh = BKE_modifier_get_evaluated_mesh_from_object(ctx, obr); + bool target_mesh_free; + Mesh *target_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(obr, &target_mesh_free); /* We must check that we do have a valid target_mesh! */ if (target_mesh != NULL) { @@ -529,6 +530,10 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes MEM_SAFE_FREE(dists_v); MEM_SAFE_FREE(dists_e); MEM_SAFE_FREE(dists_f); + + if (target_mesh_free) { + BKE_id_free(NULL, target_mesh); + } } /* Else, fall back to default obj2vert behavior. */ else { |