merge with/from trunk at r35190
[blender.git] / source / blender / modifiers / intern / MOD_meshdeform.c
index b89db2fdc2d9bd37edc2a8d05e190fb91f6b2353..a34eff6120c20168b26a14cd7ec73df39d0004d1 100644 (file)
 *
 */
 
+/** \file blender/modifiers/intern/MOD_meshdeform.c
+ *  \ingroup modifiers
+ */
+
 #include "DNA_mesh_types.h"
 #include "DNA_meshdata_types.h"
 #include "DNA_object_types.h"
 
 #include "BLI_math.h"
+#include "BLI_utildefines.h"
+
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_global.h"
@@ -78,18 +84,18 @@ static void copyData(ModifierData *md, ModifierData *target)
        tmmd->object = mmd->object;
 }
 
-static CustomDataMask requiredDataMask(Object *ob, ModifierData *md)
+static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
 {      
        MeshDeformModifierData *mmd = (MeshDeformModifierData *)md;
        CustomDataMask dataMask = 0;
 
        /* ask for vertexgroups if we need them */
-       if(mmd->defgrp_name[0]) dataMask |= (1 << CD_MDEFORMVERT);
+       if(mmd->defgrp_name[0]) dataMask |= CD_MASK_MDEFORMVERT;
 
        return dataMask;
 }
 
-static int isDisabled(ModifierData *md, int useRenderParams)
+static int isDisabled(ModifierData *md, int UNUSED(useRenderParams))
 {
        MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
 
@@ -106,9 +112,10 @@ static void foreachObjectLink(
        walk(userData, ob, &mmd->object);
 }
 
-static void updateDepgraph(
-                                                 ModifierData *md, DagForest *forest, struct Scene *scene, Object *ob,
-          DagNode *obNode)
+static void updateDepgraph(ModifierData *md, DagForest *forest,
+                                               struct Scene *UNUSED(scene),
+                                               Object *UNUSED(ob),
+                                               DagNode *obNode)
 {
        MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
 
@@ -205,7 +212,7 @@ static void meshdeformModifier_do(
        /* if we don't have one computed, use derivedmesh from data
         * without any modifiers */
        if(!cagedm) {
-               cagedm= get_dm(md->scene, mmd->object, NULL, NULL, NULL, 0);
+               cagedm= get_dm(mmd->object, NULL, NULL, NULL, 0);
                if(cagedm)
                        cagedm->needsFree= 1;
        }
@@ -339,11 +346,14 @@ static void meshdeformModifier_do(
        cagedm->release(cagedm);
 }
 
-static void deformVerts(
-                                          ModifierData *md, Object *ob, DerivedMesh *derivedData,
-       float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+static void deformVerts(ModifierData *md, Object *ob,
+                                               DerivedMesh *derivedData,
+                                               float (*vertexCos)[3],
+                                               int numVerts,
+                                               int UNUSED(useRenderParams),
+                                               int UNUSED(isFinalCalc))
 {
-       DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);;
+       DerivedMesh *dm= get_dm(ob, NULL, derivedData, NULL, 0);
 
        modifier_vgroup_cache(md, vertexCos); /* if next modifier needs original vertices */
        
@@ -353,10 +363,13 @@ static void deformVerts(
                dm->release(dm);
 }
 
-static void deformVertsEM(ModifierData *md, Object *ob, struct BMEditMesh *editData,
-         DerivedMesh *derivedData, float (*vertexCos)[3], int numVerts)
+static void deformVertsEM(ModifierData *md, Object *ob,
+                                               struct EditMesh *UNUSED(editData),
+                                               DerivedMesh *derivedData,
+                                               float (*vertexCos)[3],
+                                               int numVerts)
 {
-       DerivedMesh *dm= get_dm(md->scene, ob, NULL, derivedData, NULL, 0);;
+       DerivedMesh *dm= get_dm(ob, NULL, derivedData, NULL, 0);
 
        meshdeformModifier_do(md, ob, dm, vertexCos, numVerts);
 
@@ -437,6 +450,7 @@ ModifierTypeInfo modifierType_MeshDeform = {
 
        /* copyData */          copyData,
        /* deformVerts */       deformVerts,
+       /* deformMatrices */    0,
        /* deformVertsEM */     deformVertsEM,
        /* deformMatricesEM */  0,
        /* applyModifier */     0,
@@ -447,6 +461,7 @@ ModifierTypeInfo modifierType_MeshDeform = {
        /* isDisabled */        isDisabled,
        /* updateDepgraph */    updateDepgraph,
        /* dependsOnTime */     0,
+       /* dependsOnNormals */  0,
        /* foreachObjectLink */ foreachObjectLink,
        /* foreachIDLink */     0,
 };