Merge branch 'master' into blender2.8
[blender.git] / source / blender / modifiers / intern / MOD_hook.c
index 1763e9ab863098393d0f5353934e4dc70bfb818b..829546521a09d7e734f42ff7f7ce67f9c82297f0 100644 (file)
@@ -46,8 +46,6 @@
 #include "BKE_deform.h"
 #include "BKE_colortools.h"
 
-
-#include "depsgraph_private.h"
 #include "MEM_guardedalloc.h"
 
 #include "MOD_util.h"
@@ -111,20 +109,6 @@ static void foreachObjectLink(
        walk(userData, ob, &hmd->object, IDWALK_CB_NOP);
 }
 
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
-       HookModifierData *hmd = (HookModifierData *) md;
-
-       if (hmd->object) {
-               DagNode *curNode = dag_get_node(ctx->forest, hmd->object);
-               
-               if (hmd->subtarget[0])
-                       dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA | DAG_RL_DATA_DATA, "Hook Modifier");
-               else
-                       dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA, "Hook Modifier");
-       }
-}
-
 static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 {
        HookModifierData *hmd = (HookModifierData *)md;
@@ -361,32 +345,31 @@ static void deformVerts_do(HookModifierData *hmd, Object *ob, DerivedMesh *dm,
        }
 }
 
-static void deformVerts(ModifierData *md, Object *ob, DerivedMesh *derivedData,
-                        float (*vertexCos)[3], int numVerts,
-                        ModifierApplyFlag UNUSED(flag))
+static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx, DerivedMesh *derivedData,
+                        float (*vertexCos)[3], int numVerts)
 {
        HookModifierData *hmd = (HookModifierData *) md;
        DerivedMesh *dm = derivedData;
        /* We need a valid dm for meshes when a vgroup is set... */
-       if (!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
-               dm = get_dm(ob, NULL, dm, NULL, false, false);
+       if (!dm && ctx->object->type == OB_MESH && hmd->name[0] != '\0')
+               dm = get_dm(ctx->object, NULL, dm, NULL, false, false);
 
-       deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
+       deformVerts_do(hmd, ctx->object, dm, vertexCos, numVerts);
 
        if (derivedData != dm)
                dm->release(dm);
 }
 
-static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editData,
+static void deformVertsEM(ModifierData *md, const ModifierEvalContext *ctx, struct BMEditMesh *editData,
                           DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 {
        HookModifierData *hmd = (HookModifierData *) md;
        DerivedMesh *dm = derivedData;
        /* We need a valid dm for meshes when a vgroup is set... */
-       if (!dm && ob->type == OB_MESH && hmd->name[0] != '\0')
-               dm = get_dm(ob, editData, dm, NULL, false, false);
+       if (!dm && ctx->object->type == OB_MESH && hmd->name[0] != '\0')
+               dm = get_dm(ctx->object, editData, dm, NULL, false, false);
 
-       deformVerts_do(hmd, ob, dm, vertexCos, numVerts);
+       deformVerts_do(hmd, ctx->object, dm, vertexCos, numVerts);
 
        if (derivedData != dm)
                dm->release(dm);
@@ -402,17 +385,25 @@ ModifierTypeInfo modifierType_Hook = {
                                eModifierTypeFlag_AcceptsLattice |
                                eModifierTypeFlag_SupportsEditmode,
        /* copyData */          copyData,
-       /* deformVerts */       deformVerts,
+
+       /* deformVerts_DM */    deformVerts,
+       /* deformMatrices_DM */ NULL,
+       /* deformVertsEM_DM */  deformVertsEM,
+       /* deformMatricesEM_DM*/NULL,
+       /* applyModifier_DM */  NULL,
+       /* applyModifierEM_DM */NULL,
+
+       /* deformVerts */       NULL,
        /* deformMatrices */    NULL,
-       /* deformVertsEM */     deformVertsEM,
+       /* deformVertsEM */     NULL,
        /* deformMatricesEM */  NULL,
        /* applyModifier */     NULL,
        /* applyModifierEM */   NULL,
+
        /* initData */          initData,
        /* requiredDataMask */  requiredDataMask,
        /* freeData */          freeData,
        /* isDisabled */        isDisabled,
-       /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     NULL,
        /* dependsOnNormals */  NULL,