From 47eabae951b059f9ecb753cec96bf27b187a5522 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Fri, 23 Oct 2020 14:36:57 +0200 Subject: UI: Datatransfer modifier: set mix factor inactive when not in use For Customdata layer copying, interpolation with the mixfactor is only done for certain mix modes, now set the UI inactive if the mixfactor is not in use. Namely, the modes are the "Above / Below Threshold" which are only used for flags, colors and normals and mixing is not supported in these cases. Spotted while looking into T81914. Differential Revision: https://developer.blender.org/D9327 --- source/blender/modifiers/intern/MOD_datatransfer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_datatransfer.c') diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c index 17d716b731c..d841ace2cce 100644 --- a/source/blender/modifiers/intern/MOD_datatransfer.c +++ b/source/blender/modifiers/intern/MOD_datatransfer.c @@ -264,7 +264,14 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) uiItemR(sub, ptr, "use_object_transform", 0, "", ICON_ORIENTATION_GLOBAL); uiItemR(layout, ptr, "mix_mode", 0, NULL, ICON_NONE); - uiItemR(layout, ptr, "mix_factor", 0, NULL, ICON_NONE); + + row = uiLayoutRow(layout, false); + uiLayoutSetActive(row, + !ELEM(RNA_enum_get(ptr, "mix_mode"), + CDT_MIX_NOMIX, + CDT_MIX_REPLACE_ABOVE_THRESHOLD, + CDT_MIX_REPLACE_BELOW_THRESHOLD)); + uiItemR(row, ptr, "mix_factor", 0, NULL, ICON_NONE); modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL); -- cgit v1.2.3