diff options
author | Bastien Montagne <bastien@blender.org> | 2020-04-10 23:00:21 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-04-11 18:16:58 +0300 |
commit | 5cc7036aa39506f3af3608ad450f1fdf6b2f3347 (patch) | |
tree | 99d6644347b40ec7d3855d9f8fa271dbb8ecc2b1 /source/blender/modifiers/intern/MOD_wave.c | |
parent | b0350d8310f253b01b57a5a46ca982cc787b9478 (diff) |
Factorize some common modifiers depsgraph relation update code.
Add a utility to deal with common 'object or posebone transform' case.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_wave.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_wave.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 024d70bcfda..02950870e8e 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -98,22 +98,16 @@ static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx) { WaveModifierData *wmd = (WaveModifierData *)md; + if (wmd->objectcenter != NULL) { DEG_add_object_relation(ctx->node, wmd->objectcenter, DEG_OB_COMP_TRANSFORM, "Wave Modifier"); } - if (wmd->map_object != NULL) { - if (wmd->map_bone[0] && wmd->map_object->type == OB_ARMATURE) { - DEG_add_object_relation( - ctx->node, wmd->map_object, DEG_OB_COMP_EVAL_POSE, "Wave Modifier"); - } - else { - DEG_add_object_relation( - ctx->node, wmd->map_object, DEG_OB_COMP_TRANSFORM, "Wave Modifier"); - } - } + MOD_depsgraph_update_object_bone_relation( + ctx->node, wmd->map_object, wmd->map_bone, "Wave Modifier"); if (wmd->objectcenter != NULL || wmd->map_object != NULL) { DEG_add_modifier_to_transform_relation(ctx->node, "Wave Modifier"); } + if (wmd->texture != NULL) { DEG_add_generic_id_relation(ctx->node, &wmd->texture->id, "Wave Modifier"); } |