Merge remote-tracking branch 'origin/master' into blender2.8
[blender.git] / source / blender / modifiers / intern / MOD_fluidsim.c
index 1964e940cb2943fb8cc69dd4e9137ea1f3f45fa5..85eb7b2ffc9b55cc85c22f8a178d63410db16d65 100644 (file)
@@ -41,9 +41,9 @@
 
 
 #include "BKE_cdderivedmesh.h"
+#include "BKE_layer.h"
 #include "BKE_modifier.h"
 
-#include "depsgraph_private.h"
 #include "DEG_depsgraph_build.h"
 
 #include "MOD_fluidsim_util.h"
@@ -101,33 +101,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        return result ? result : dm;
 }
 
-static void updateDepgraph(
-        ModifierData *md, DagForest *forest,
-        struct Main *UNUSED(bmain), Scene *scene,
-        Object *ob, DagNode *obNode)
-{
-       FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
-       Base *base;
-
-       if (fluidmd && fluidmd->fss) {
-               if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
-                       for (base = scene->base.first; base; base = base->next) {
-                               Object *ob1 = base->object;
-                               if (ob1 != ob) {
-                                       FluidsimModifierData *fluidmdtmp =
-                                               (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim);
-                                       
-                                       /* only put dependencies from NON-DOMAIN fluids in here */
-                                       if (fluidmdtmp && fluidmdtmp->fss && (fluidmdtmp->fss->type != OB_FLUIDSIM_DOMAIN)) {
-                                               DagNode *curNode = dag_get_node(forest, ob1);
-                                               dag_add_relation(forest, curNode, obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Fluidsim Object");
-                                       }
-                               }
-                       }
-               }
-       }
-}
-
 static void updateDepsgraph(ModifierData *md,
                             struct Main *UNUSED(bmain),
                             struct Scene *scene,
@@ -137,9 +110,8 @@ static void updateDepsgraph(ModifierData *md,
        FluidsimModifierData *fluidmd = (FluidsimModifierData *) md;
        if (fluidmd && fluidmd->fss) {
                if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) {
-                       Base *base;
-                       for (base = scene->base.first; base; base = base->next) {
-                               Object *ob1 = base->object;
+                       FOREACH_SCENE_OBJECT(scene, ob1)
+                       {
                                if (ob1 != ob) {
                                        FluidsimModifierData *fluidmdtmp =
                                                (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim);
@@ -150,6 +122,7 @@ static void updateDepsgraph(ModifierData *md,
                                        }
                                }
                        }
+                       FOREACH_SCENE_OBJECT_END
                }
        }
 }
@@ -181,7 +154,6 @@ ModifierTypeInfo modifierType_Fluidsim = {
        /* requiredDataMask */  NULL,
        /* freeData */          freeData,
        /* isDisabled */        NULL,
-       /* updateDepgraph */    updateDepgraph,
        /* updateDepsgraph */   updateDepsgraph,
        /* dependsOnTime */     dependsOnTime,
        /* dependsOnNormals */  NULL,