From df045206021bdd448482f9d022f73029d28f7fc3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 22 Feb 2018 12:54:06 +0100 Subject: Depsgraph: Wrap all arguments foe modifiers relations update into a struct Makes it easier to add or remove fields needed to update relations. --- source/blender/modifiers/intern/MOD_lattice.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_lattice.c') diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index dc246084dca..0df6329cf04 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -91,34 +91,26 @@ static void foreachObjectLink( walk(userData, ob, &lmd->object, IDWALK_CB_NOP); } -static void updateDepgraph(ModifierData *md, DagForest *forest, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *UNUSED(ob), - DagNode *obNode) +static void updateDepgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { LatticeModifierData *lmd = (LatticeModifierData *) md; if (lmd->object) { - DagNode *latNode = dag_get_node(forest, lmd->object); + DagNode *latNode = dag_get_node(ctx->forest, lmd->object); - dag_add_relation(forest, latNode, obNode, + dag_add_relation(ctx->forest, latNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Lattice Modifier"); } } -static void updateDepsgraph(ModifierData *md, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *object, - struct DepsNodeHandle *node) +static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { LatticeModifierData *lmd = (LatticeModifierData *)md; if (lmd->object != NULL) { - DEG_add_object_relation(node, lmd->object, DEG_OB_COMP_GEOMETRY, "Lattice Modifier"); - DEG_add_object_relation(node, lmd->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier"); + DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_GEOMETRY, "Lattice Modifier"); + DEG_add_object_relation(ctx->node, lmd->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier"); } - DEG_add_object_relation(node, object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier"); + DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Lattice Modifier"); } static void deformVerts(ModifierData *md, Object *ob, -- cgit v1.2.3