diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-10-23 15:36:57 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-10-26 18:24:22 +0300 |
commit | 47eabae951b059f9ecb753cec96bf27b187a5522 (patch) | |
tree | e2a0d5cc6f13e205cff7f61c8c31188241c32cf4 /source/blender | |
parent | 5365409ec0e61d6f9475981fd52b8f01cc5c1452 (diff) |
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
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/modifiers/intern/MOD_datatransfer.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); |