Merge branch 'master' into blender2.8
[blender.git] / source / blender / modifiers / intern / MOD_surface.c
index cd65112fd1acd04355fe1fb583fdfb9c04b6f515..c05d021a8452d36753addfd8af0e41e26b34c602 100644 (file)
@@ -83,11 +83,10 @@ static bool dependsOnTime(ModifierData *UNUSED(md))
 }
 
 static void deformVerts(
-        ModifierData *md, Object *ob,
+        ModifierData *md, const ModifierEvalContext *ctx,
         DerivedMesh *derivedData,
         float (*vertexCos)[3],
-        int UNUSED(numVerts),
-        ModifierApplyFlag UNUSED(flag))
+        int UNUSED(numVerts))
 {
        SurfaceModifierData *surmd = (SurfaceModifierData *) md;
        
@@ -96,9 +95,9 @@ static void deformVerts(
 
        /* if possible use/create DerivedMesh */
        if (derivedData) surmd->dm = CDDM_copy(derivedData);
-       else surmd->dm = get_dm(ob, NULL, NULL, NULL, false, false);
+       else surmd->dm = get_dm(ctx->object, NULL, NULL, NULL, false, false);
        
-       if (!ob->pd) {
+       if (!ctx->object->pd) {
                printf("SurfaceModifier deformVerts: Should not happen!\n");
                return;
        }
@@ -139,7 +138,7 @@ static void deformVerts(
                /* convert to global coordinates and calculate velocity */
                for (i = 0, x = surmd->x, v = surmd->v; i < numverts; i++, x++, v++) {
                        vec = CDDM_get_vert(surmd->dm, i)->co;
-                       mul_m4_v3(ob->obmat, vec);
+                       mul_m4_v3(ctx->object->obmat, vec);
 
                        if (init)
                                v->co[0] = v->co[1] = v->co[2] = 0.0f;
@@ -174,17 +173,25 @@ ModifierTypeInfo modifierType_Surface = {
                                eModifierTypeFlag_NoUserAdd,
 
        /* copyData */          NULL,
-       /* deformVerts */       deformVerts,
+
+       /* deformVerts_DM */    deformVerts,
+       /* deformMatrices_DM */ NULL,
+       /* deformVertsEM_DM */  NULL,
+       /* deformMatricesEM_DM*/NULL,
+       /* applyModifier_DM */  NULL,
+       /* applyModifierEM_DM */NULL,
+
+       /* deformVerts */       NULL,
        /* deformMatrices */    NULL,
        /* deformVertsEM */     NULL,
        /* deformMatricesEM */  NULL,
        /* applyModifier */     NULL,
        /* applyModifierEM */   NULL,
+
        /* initData */          initData,
        /* requiredDataMask */  NULL,
        /* freeData */          freeData,
        /* isDisabled */        NULL,
-       /* updateDepgraph */    NULL,
        /* updateDepsgraph */   NULL,
        /* dependsOnTime */     dependsOnTime,
        /* dependsOnNormals */  NULL,