From 5cc7036aa39506f3af3608ad450f1fdf6b2f3347 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 10 Apr 2020 22:00:21 +0200 Subject: Factorize some common modifiers depsgraph relation update code. Add a utility to deal with common 'object or posebone transform' case. --- source/blender/modifiers/intern/MOD_weightvgedit.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_weightvgedit.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index e304ca31e86..c80a5f63903 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -45,6 +45,7 @@ #include "MEM_guardedalloc.h" #include "MOD_modifiertypes.h" +#include "MOD_util.h" #include "MOD_weightvg_util.h" /************************************** @@ -135,14 +136,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte { WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md; if (wmd->mask_tex_map_obj != NULL && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) { - if (wmd->mask_tex_map_bone[0] && wmd->mask_tex_map_obj->type == OB_ARMATURE) { - DEG_add_object_relation( - ctx->node, wmd->mask_tex_map_obj, DEG_OB_COMP_EVAL_POSE, "WeightVGEdit Modifier"); - } - else { - DEG_add_object_relation( - ctx->node, wmd->mask_tex_map_obj, DEG_OB_COMP_TRANSFORM, "WeightVGEdit Modifier"); - } + MOD_depsgraph_update_object_bone_relation( + ctx->node, wmd->mask_tex_map_obj, wmd->mask_tex_map_bone, "WeightVGEdit Modifier"); DEG_add_modifier_to_transform_relation(ctx->node, "WeightVGEdit Modifier"); } else if (wmd->mask_tex_mapping == MOD_DISP_MAP_GLOBAL) { -- cgit v1.2.3