From 4f9a56cbc4e8719ee421a57fd6695bed633c591b Mon Sep 17 00:00:00 2001 From: Cody Winchester Date: Fri, 10 Apr 2020 14:03:36 +0200 Subject: Modifiers: Add Bone option for Texture Mask Object This patch adds the option to use an armature bone in place of an object for texture mask coordinates. This affects the 3 vertex weight modifiers, the displace modifier, the warp modifier, and the wave modifier. With minor changes from Bastien Montagne (@mont29). Differential Revision: https://developer.blender.org/D7348 --- source/blender/modifiers/intern/MOD_weightvgmix.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_weightvgmix.c') diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 4984853d41e..b109d0af5aa 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -181,8 +181,14 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte { WeightVGMixModifierData *wmd = (WeightVGMixModifierData *)md; if (wmd->mask_tex_map_obj != NULL && wmd->mask_tex_mapping == MOD_DISP_MAP_OBJECT) { - DEG_add_object_relation( - ctx->node, wmd->mask_tex_map_obj, DEG_OB_COMP_TRANSFORM, "WeightVGMix Modifier"); + 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, "WeightVGMix Modifier"); + } + else { + DEG_add_object_relation( + ctx->node, wmd->mask_tex_map_obj, DEG_OB_COMP_TRANSFORM, "WeightVGMix Modifier"); + } DEG_add_object_relation( ctx->node, wmd->mask_tex_map_obj, DEG_OB_COMP_GEOMETRY, "WeightVGMix Modifier"); @@ -395,6 +401,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes wmd->mask_tex_use_channel, wmd->mask_tex_mapping, wmd->mask_tex_map_obj, + wmd->mask_tex_map_bone, wmd->mask_tex_uvlayer_name, invert_vgroup_mask); -- cgit v1.2.3