Merge branch 'master' into blender2.8
[blender.git] / source / blender / modifiers / intern / MOD_meshdeform.c
index 8f197ce3b997b1719e54347e0aaaa043c99e8d03..47b51ac170b6efefc942b60e371c7e7988e8d85f 100644 (file)
@@ -47,8 +47,6 @@
 #include "BKE_deform.h"
 #include "BKE_editmesh.h"
 
-#include "depsgraph_private.h"
-
 #include "MEM_guardedalloc.h"
 
 #include "MOD_util.h"
@@ -122,23 +120,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 +275,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;
@@ -321,7 +302,7 @@ static void meshdeformModifier_do(
         */
        if (mmd->object == md->scene->obedit) {
                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 +411,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 +421,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 +435,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 +524,6 @@ ModifierTypeInfo modifierType_MeshDeform = {
        /* requiredDataMask */  requiredDataMask,
        /* freeData */          freeData,
        /* isDisabled */        isDisabled,
-       /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     NULL,
        /* dependsOnNormals */  NULL,