diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshdeform.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshdeform.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 99f0c892a3f..e8fc832b597 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -47,10 +47,10 @@ #include "BKE_deform.h" #include "BKE_editmesh.h" -#include "depsgraph_private.h" - #include "MEM_guardedalloc.h" +#include "DEG_depsgraph.h" + #include "MOD_util.h" #ifdef __SSE2__ @@ -122,23 +122,6 @@ static void foreachObjectLink( walk(userData, ob, &mmd->object, IDWALK_CB_NOP); } -static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *UNUSED(ob), - DagNode *obNode) -{ - MeshDeformModifierData *mmd = (MeshDeformModifierData *) md; - - if (mmd->object) { - DagNode *curNode = dag_get_node(forest, mmd->object); - - dag_add_relation(forest, curNode, obNode, - DAG_RL_DATA_DATA | DAG_RL_OB_DATA | DAG_RL_DATA_OB | DAG_RL_OB_OB, - "Mesh Deform Modifier"); - } -} - static void updateDepsgraph(ModifierData *md, struct Main *UNUSED(bmain), struct Scene *UNUSED(scene), @@ -294,7 +277,7 @@ static void meshdeform_vert_task( } static void meshdeformModifier_do( - ModifierData *md, Object *ob, DerivedMesh *dm, + ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *dm, float (*vertexCos)[3], int numVerts) { MeshDeformModifierData *mmd = (MeshDeformModifierData *) md; @@ -319,9 +302,9 @@ static void meshdeformModifier_do( * * We'll support this case once granular dependency graph is landed. */ - if (mmd->object == md->scene->obedit) { + if (mmd->object == OBEDIT_FROM_EVAL_CTX(eval_ctx)) { BMEditMesh *em = BKE_editmesh_from_object(mmd->object); - tmpdm = editbmesh_get_derived_cage_and_final(md->scene, mmd->object, em, 0, &cagedm); + tmpdm = editbmesh_get_derived_cage_and_final(eval_ctx, md->scene, mmd->object, em, 0, &cagedm); if (tmpdm) tmpdm->release(tmpdm); } @@ -430,7 +413,7 @@ static void meshdeformModifier_do( cagedm->release(cagedm); } -static void deformVerts(ModifierData *md, Object *ob, +static void deformVerts(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts, @@ -440,13 +423,13 @@ static void deformVerts(ModifierData *md, Object *ob, modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */ - meshdeformModifier_do(md, ob, dm, vertexCos, numVerts); + meshdeformModifier_do(md, eval_ctx, ob, dm, vertexCos, numVerts); if (dm && dm != derivedData) dm->release(dm); } -static void deformVertsEM(ModifierData *md, Object *ob, +static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, struct BMEditMesh *UNUSED(editData), DerivedMesh *derivedData, float (*vertexCos)[3], @@ -454,7 +437,7 @@ static void deformVertsEM(ModifierData *md, Object *ob, { DerivedMesh *dm = get_dm(ob, NULL, derivedData, NULL, false, false); - meshdeformModifier_do(md, ob, dm, vertexCos, numVerts); + meshdeformModifier_do(md, eval_ctx, ob, dm, vertexCos, numVerts); if (dm && dm != derivedData) dm->release(dm); @@ -543,7 +526,6 @@ ModifierTypeInfo modifierType_MeshDeform = { /* requiredDataMask */ requiredDataMask, /* freeData */ freeData, /* isDisabled */ isDisabled, - /* updateDepgraph */ updateDepgraph, /* updateDepsgraph */ updateDepsgraph, /* dependsOnTime */ NULL, /* dependsOnNormals */ NULL, |