Merge branch 'master' into blender2.8
[blender.git] / source / blender / modifiers / intern / MOD_cast.c
index bac95e4c1c1960e4a2efeabc171484f2aec464be..18c64a24392414fa0d7380cd3f87cedd4f038b95 100644 (file)
@@ -45,9 +45,6 @@
 #include "BKE_library_query.h"
 #include "BKE_modifier.h"
 
-
-#include "depsgraph_private.h"
-
 #include "MOD_util.h"
 
 static void initData(ModifierData *md)
@@ -95,18 +92,6 @@ static void foreachObjectLink(
        walk(userData, ob, &cmd->object, IDWALK_CB_NOP);
 }
 
-static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
-{
-       CastModifierData *cmd = (CastModifierData *) md;
-
-       if (cmd->object) {
-               DagNode *curNode = dag_get_node(ctx->forest, cmd->object);
-
-               dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_OB_DATA,
-                                "Cast Modifier");
-       }
-}
-
 static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 {
        CastModifierData *cmd = (CastModifierData *)md;
@@ -434,22 +419,21 @@ static void cuboid_do(
        }
 }
 
-static void deformVerts(ModifierData *md, Object *ob,
+static void deformVerts(ModifierData *md, const ModifierEvalContext *ctx,
                         DerivedMesh *derivedData,
                         float (*vertexCos)[3],
-                        int numVerts,
-                        ModifierApplyFlag UNUSED(flag))
+                        int numVerts)
 {
        DerivedMesh *dm = NULL;
        CastModifierData *cmd = (CastModifierData *)md;
 
-       dm = get_dm(ob, NULL, derivedData, NULL, false, false);
+       dm = get_dm(ctx->object, NULL, derivedData, NULL, false, false);
 
        if (cmd->type == MOD_CAST_TYPE_CUBOID) {
-               cuboid_do(cmd, ob, dm, vertexCos, numVerts);
+               cuboid_do(cmd, ctx->object, dm, vertexCos, numVerts);
        }
        else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
-               sphere_do(cmd, ob, dm, vertexCos, numVerts);
+               sphere_do(cmd, ctx->object, dm, vertexCos, numVerts);
        }
 
        if (dm != derivedData)
@@ -457,17 +441,18 @@ static void deformVerts(ModifierData *md, Object *ob,
 }
 
 static void deformVertsEM(
-        ModifierData *md, Object *ob, struct BMEditMesh *editData,
+        ModifierData *md, const ModifierEvalContext *ctx,
+        struct BMEditMesh *editData,
         DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
 {
-       DerivedMesh *dm = get_dm(ob, editData, derivedData, NULL, false, false);
+       DerivedMesh *dm = get_dm(ctx->object, editData, derivedData, NULL, false, false);
        CastModifierData *cmd = (CastModifierData *)md;
 
        if (cmd->type == MOD_CAST_TYPE_CUBOID) {
-               cuboid_do(cmd, ob, dm, vertexCos, numVerts);
+               cuboid_do(cmd, ctx->object, dm, vertexCos, numVerts);
        }
        else { /* MOD_CAST_TYPE_SPHERE or MOD_CAST_TYPE_CYLINDER */
-               sphere_do(cmd, ob, dm, vertexCos, numVerts);
+               sphere_do(cmd, ctx->object, dm, vertexCos, numVerts);
        }
 
        if (dm != derivedData)
@@ -485,17 +470,25 @@ ModifierTypeInfo modifierType_Cast = {
                                eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          modifier_copyData_generic,
-       /* 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 */          NULL,
        /* isDisabled */        isDisabled,
-       /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     NULL,
        /* dependsOnNormals */  NULL,