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_displace.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_displace.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_displace.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 7651675934c..d2d82ca23d2 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -155,18 +155,14 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) return ((!dmd->texture && dmd->direction == MOD_DISP_DIR_RGB_XYZ) || dmd->strength == 0.0f); } -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) { DisplaceModifierData *dmd = (DisplaceModifierData *) md; if (dmd->map_object && dmd->texmapping == MOD_DISP_MAP_OBJECT) { - DagNode *curNode = dag_get_node(forest, dmd->map_object); + DagNode *curNode = dag_get_node(ctx->forest, dmd->map_object); - dag_add_relation(forest, curNode, obNode, + dag_add_relation(ctx->forest, curNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Displace Modifier"); } @@ -175,26 +171,22 @@ static void updateDepgraph(ModifierData *md, DagForest *forest, (ELEM(dmd->direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ) && dmd->space == MOD_DISP_SPACE_GLOBAL)) { - dag_add_relation(forest, obNode, obNode, + dag_add_relation(ctx->forest, ctx->obNode, ctx->obNode, DAG_RL_DATA_DATA | DAG_RL_OB_DATA, "Displace Modifier"); } } -static void updateDepsgraph(ModifierData *md, - struct Main *UNUSED(bmain), - struct Scene *UNUSED(scene), - Object *ob, - struct DepsNodeHandle *node) +static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { DisplaceModifierData *dmd = (DisplaceModifierData *)md; if (dmd->map_object != NULL && dmd->texmapping == MOD_DISP_MAP_OBJECT) { - DEG_add_object_relation(node, dmd->map_object, DEG_OB_COMP_TRANSFORM, "Displace Modifier"); + DEG_add_object_relation(ctx->node, dmd->map_object, DEG_OB_COMP_TRANSFORM, "Displace Modifier"); } if (dmd->texmapping == MOD_DISP_MAP_GLOBAL || (ELEM(dmd->direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ) && dmd->space == MOD_DISP_SPACE_GLOBAL)) { - DEG_add_object_relation(node, ob, DEG_OB_COMP_TRANSFORM, "Displace Modifier"); + DEG_add_object_relation(ctx->node, ctx->object, DEG_OB_COMP_TRANSFORM, "Displace Modifier"); } } |