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.
This commit is contained in:
Brecht Van Lommel 2021-11-25 14:15:01 +01:00
parent ffddf9e5c9
commit 3bf10e5d0a
Notes: blender-bot 2023-11-24 11:35:39 +01:00
Referenced by issue #90063, Regression: Set curve radius does not work
Referenced by issue #89996, Resetting multi-button value does not work when active button value is the same
Referenced by issue #87448, Blender re-evaluates modifiers unnecessarily when parameters are not changed
Referenced by issue #40009, Double click list renaming not working on heavy scenes
1 changed files with 10 additions and 0 deletions

View File

@ -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);