[Bf-blender-cvs] [3bf10e5d0ac] blender-v3.0-release: Fix T89996, T90063: bugs with multi-button reset and entering values in popups

Brecht Van Lommel noreply at git.blender.org
Thu Nov 25 14:47:00 CET 2021


Commit: 3bf10e5d0ac297a70a9bc294fff0448e6b11fc20
Author: Brecht Van Lommel
Date:   Thu Nov 25 14:15:01 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB3bf10e5d0ac297a70a9bc294fff0448e6b11fc20

Fix T89996, T90063: bugs with multi-button reset and entering values in popups

This reverts the changes to fix T87448, where entering the same value in number
buttons causes an unnecessary update. This is not stable enough for 3.0 and so
is being reverted, better to have an unnecessary update than no update in other
cases.

This effectively reverts the changes from rBeb06ccc32462 and follow up fixes
rBe1a9ba94c599, rBbbb52a462ef9, rBec30cf0b742f, and rB071799d4fc44. The code is
disabled with a comment on how it could be implemented better.

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 6d69724efef..87a60f45257 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -1266,12 +1266,22 @@ static void ui_apply_but_TAB(bContext *C, uiBut *but, uiHandleButtonData *data)
 static void ui_apply_but_NUM(bContext *C, uiBut *but, uiHandleButtonData *data)
 {
   if (data->str) {
+    /* This is intended to avoid unnecessary updates when the value stays the same, however there
+     * are issues with the current implementation. It does not work with multi-button editing
+     * (T89996) or operator popups where a number button requires an update even if the value is
+     * unchanged (T89996).
+     *
+     * Trying to detect changes at this level is not reliable. Instead it could be done at the
+     * level of RNA update/set, skipping RNA update if RNA set did not change anything, instead
+     * of skipping all button updates. */
+#if 0
     double value;
     /* Check if the string value is a number and cancel if it's equal to the startvalue. */
     if (ui_but_string_eval_number(C, but, data->str, &value) && (value == data->startvalue)) {
       data->cancel = true;
       return;
     }
+#endif
 
     if (ui_but_string_set(C, but, data->str)) {
       data->value = ui_but_value_get(but);



More information about the Bf-blender-cvs mailing list