Commit: 04ff2784da884675366091f88a08734e6ddbbce8
Author: Joshua Leung
Date:   Mon Oct 26 23:24:41 2015 +1300
Branches: master
https://developer.blender.org/rB04ff2784da884675366091f88a08734e6ddbbce8

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.

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

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 010bb8b..52666e8 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -7555,8 +7555,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)) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to