[Bf-blender-cvs] [47eabae951b] blender-v2.91-release: UI: Datatransfer modifier: set mix factor inactive when not in use
Philipp Oeser
noreply at git.blender.org
Mon Oct 26 16:33:01 CET 2020
Commit: 47eabae951b059f9ecb753cec96bf27b187a5522
Author: Philipp Oeser
Date: Fri Oct 23 14:36:57 2020 +0200
Branches: blender-v2.91-release
https://developer.blender.org/rB47eabae951b059f9ecb753cec96bf27b187a5522
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
===================================================================
M 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);
More information about the Bf-blender-cvs
mailing list