diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-22 14:54:06 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-22 14:54:06 +0300 |
commit | df045206021bdd448482f9d022f73029d28f7fc3 (patch) | |
tree | b2246d23a94c05967811a67a366671254736864b /source/blender/modifiers/intern/MOD_softbody.c | |
parent | 93072e44d11efe9528d2bb7a3a62784331bf0a08 (diff) |
Depsgraph: Wrap all arguments foe modifiers relations update into a struct
Makes it easier to add or remove fields needed to update relations.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_softbody.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_softbody.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index 8b33f197490..e760ff5ca01 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -62,36 +62,27 @@ static bool dependsOnTime(ModifierData *UNUSED(md)) return true; } -static void updateDepgraph(ModifierData *UNUSED(md), DagForest *forest, - struct Main *UNUSED(bmain), - Scene *scene, Object *ob, DagNode *obNode) +static void updateDepgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgraphContext *ctx) { - if (ob->soft) { + if (ctx->object->soft) { #ifdef WITH_LEGACY_DEPSGRAPH /* Actual code uses ccd_build_deflector_hash */ - dag_add_collision_relations(forest, scene, ob, obNode, ob->soft->collision_group, ob->lay, eModifierType_Collision, NULL, false, "Softbody Collision"); + dag_add_collision_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, ctx->object->soft->collision_group, ctx->object->lay, eModifierType_Collision, NULL, false, "Softbody Collision"); - dag_add_forcefield_relations(forest, scene, ob, obNode, ob->soft->effector_weights, true, 0, "Softbody Field"); + dag_add_forcefield_relations(ctx->forest, ctx->scene, ctx->object, ctx->obNode, ctx->object->soft->effector_weights, true, 0, "Softbody Field"); #else - (void)forest; - (void)scene; - (void)ob; - (void)obNode; + (void)ctx; #endif } } -static void updateDepsgraph(ModifierData *UNUSED(md), - struct Main *UNUSED(bmain), - struct Scene *scene, - Object *ob, - struct DepsNodeHandle *node) +static void updateDepsgraph(ModifierData *UNUSED(md), const ModifierUpdateDepsgraphContext *ctx) { - if (ob->soft) { + if (ctx->object->soft) { /* Actual code uses ccd_build_deflector_hash */ - DEG_add_collision_relations(node, scene, ob, ob->soft->collision_group, ob->lay, eModifierType_Collision, NULL, false, "Softbody Collision"); + DEG_add_collision_relations(ctx->node, ctx->scene, ctx->object, ctx->object->soft->collision_group, ctx->object->lay, eModifierType_Collision, NULL, false, "Softbody Collision"); - DEG_add_forcefield_relations(node, scene, ob, ob->soft->effector_weights, true, 0, "Softbody Field"); + DEG_add_forcefield_relations(ctx->node, ctx->scene, ctx->object, ctx->object->soft->effector_weights, true, 0, "Softbody Field"); } } |