Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2015-10-26 13:24:41 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-29 13:10:16 +0300
commit299f6470049c16e388aaa07d426ca3d622c76975 (patch)
tree3b704c7dfa4b99cb6fd1c2b9a781a165fd5d4e81 /source/blender
parent1ce73aa72b5553f376db4d38fac2213753213bd8 (diff)
Fix: Prevent warnings from popping up when trying to edit driver expressions from buttons
Previously, a warning was added to provide feedback to users trying to change the values of driven properties why their edits would not have any effect on the propeerty. However, it turned out that instead of only showing up when the user tried to increment/decrement/slide the property's value, it was also firing everytime they were trying to edit the expression. That however is not what we want at all! This fix assumes that BUTTON_STATE_TEXT_EDITING is used for expression editing, and BUTTON_STATE_NUM_EDITING (or everything else) refers to the user trying to adjust the value normally.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/interface_handlers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 3fd2ba66f79..1b521400078 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -7517,8 +7517,14 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
else if (data->state == BUTTON_STATE_NUM_EDITING) {
ui_numedit_end(but, data);
- if (but->flag & UI_BUT_DRIVEN)
- WM_report(C, RPT_INFO, "Can't edit driven number value, see graph editor for the driver setup.");
+ if (but->flag & UI_BUT_DRIVEN) {
+ /* Only warn when editing stepping/dragging the value.
+ * No warnings should show for editing driver expressions though!
+ */
+ if (state != BUTTON_STATE_TEXT_EDITING) {
+ WM_report(C, RPT_INFO, "Can't edit driven number value, see graph editor for the driver setup.");
+ }
+ }
if (ui_but_is_cursor_warp(but)) {