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:
authorDalai Felinto <dfelinto@gmail.com>2018-05-24 17:40:08 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-05-24 17:43:21 +0300
commite8c8ff4f86c276e4dca884ff1a411fcbbf003fed (patch)
tree484745e65e0eb2559c62be0a7581c3102d8cb84b /source/blender/modifiers/intern/MOD_meshdeform.c
parent10e43c0aef38647d8904e758e36261c9ac0b6460 (diff)
Fix all modifiers that depended on BKE_modifier_get_evaluated_mesh_from_object
This fix applying the following modifiers: * Boolean (working already) * Array * Mesh Deform * Surface Deform * Vertex Weight Proximity This function was to return evaluated mesh. So it should get the evaluated object at all times. So in this case it makes more sense to simply pass the depsgraph (or in this case the ModifierEvalContext that contains both the depsgraph and the flag. Solution discussed with Bastien Montagne.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshdeform.c')
-rw-r--r--source/blender/modifiers/intern/MOD_meshdeform.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c
index 94adb3d9ebc..48653856178 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -275,7 +275,7 @@ static void meshdeform_vert_task(
}
static void meshdeformModifier_do(
- ModifierData *md, Object *ob, Mesh *mesh,
+ ModifierData *md, Depsgraph *depsgraph, Object *ob, Mesh *mesh,
float (*vertexCos)[3], int numVerts)
{
MeshDeformModifierData *mmd = (MeshDeformModifierData *) md;
@@ -307,7 +307,11 @@ static void meshdeformModifier_do(
free_cagemesh = true;
}
else {
- cagemesh = BKE_modifier_get_evaluated_mesh_from_object(ob, md->mode & eModifierMode_Render ? MOD_APPLY_RENDER : 0);
+ ModifierEvalContext ctx = {
+ .depsgraph = depsgraph,
+ .flag = md->mode & eModifierMode_Render ? MOD_APPLY_RENDER : 0,
+ };
+ cagemesh = BKE_modifier_get_evaluated_mesh_from_object(&ctx, ob);
}
/* if we don't have one computed, use derivedmesh from data
@@ -421,7 +425,7 @@ static void deformVerts(
modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
- meshdeformModifier_do(md, ctx->object, mesh_src, vertexCos, numVerts);
+ meshdeformModifier_do(md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, numVerts);
if (mesh_src && mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);
@@ -437,7 +441,7 @@ static void deformVertsEM(
{
Mesh *mesh_src = get_mesh(ctx->object, NULL, mesh, NULL, false, false);
- meshdeformModifier_do(md, ctx->object, mesh_src, vertexCos, numVerts);
+ meshdeformModifier_do(md, ctx->depsgraph, ctx->object, mesh_src, vertexCos, numVerts);
if (mesh_src && mesh_src != mesh) {
BKE_id_free(NULL, mesh_src);