diff options
Diffstat (limited to 'source/blender/modifiers/intern/MOD_fluidsim.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_fluidsim.c | 51 |
1 files changed, 17 insertions, 34 deletions
diff --git a/source/blender/modifiers/intern/MOD_fluidsim.c b/source/blender/modifiers/intern/MOD_fluidsim.c index 00b7f245d4c..ffa74be0b33 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim.c +++ b/source/blender/modifiers/intern/MOD_fluidsim.c @@ -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" @@ -86,9 +86,8 @@ static void copyData(const ModifierData *md, ModifierData *target) static DerivedMesh *applyModifier( - ModifierData *md, Object *ob, - DerivedMesh *dm, - ModifierApplyFlag flag) + ModifierData *md, const ModifierEvalContext *ctx, + DerivedMesh *dm) { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; DerivedMesh *result = NULL; @@ -102,43 +101,18 @@ static DerivedMesh *applyModifier( } } - result = fluidsimModifier_do(fluidmd, md->scene, ob, dm, flag & MOD_APPLY_RENDER, flag & MOD_APPLY_USECACHE); + result = fluidsimModifier_do(fluidmd, ctx, dm); return result ? result : dm; } -static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) -{ - FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; - Base *base; - - if (fluidmd && fluidmd->fss) { - if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) { - for (base = ctx->scene->base.first; base; base = base->next) { - Object *ob1 = base->object; - if (ob1 != ctx->object) { - 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(ctx->forest, ob1); - dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Fluidsim Object"); - } - } - } - } - } -} - static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { FluidsimModifierData *fluidmd = (FluidsimModifierData *) md; if (fluidmd && fluidmd->fss) { if (fluidmd->fss->type == OB_FLUIDSIM_DOMAIN) { - Base *base; - for (base = ctx->scene->base.first; base; base = base->next) { - Object *ob1 = base->object; + FOREACH_SCENE_OBJECT_BEGIN(ctx->scene, ob1) + { if (ob1 != ctx->object) { FluidsimModifierData *fluidmdtmp = (FluidsimModifierData *)modifiers_findByType(ob1, eModifierType_Fluidsim); @@ -149,6 +123,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte } } } + FOREACH_SCENE_OBJECT_END; } } } @@ -170,17 +145,25 @@ ModifierTypeInfo modifierType_Fluidsim = { eModifierTypeFlag_Single, /* copyData */ copyData, + + /* deformVerts_DM */ NULL, + /* deformMatrices_DM */ NULL, + /* deformVertsEM_DM */ NULL, + /* deformMatricesEM_DM*/NULL, + /* applyModifier_DM */ applyModifier, + /* applyModifierEM_DM */NULL, + /* deformVerts */ NULL, /* deformMatrices */ NULL, /* deformVertsEM */ NULL, /* deformMatricesEM */ NULL, - /* applyModifier */ applyModifier, + /* applyModifier */ NULL, /* applyModifierEM */ NULL, + /* initData */ initData, /* requiredDataMask */ NULL, /* freeData */ freeData, /* isDisabled */ NULL, - /* updateDepgraph */ updateDepgraph, /* updateDepsgraph */ updateDepsgraph, /* dependsOnTime */ dependsOnTime, /* dependsOnNormals */ NULL, |