[Bf-blender-cvs] [d1e8d8f40fd] blender2.8: Drivers UI: Add the "Update Dependencies" logic into the callbacks that should be run on every button press

Joshua Leung noreply at git.blender.org
Wed May 23 16:33:00 CEST 2018


Commit: d1e8d8f40fd2c75ba8d38c2a337e98ed31c94817
Author: Joshua Leung
Date:   Wed May 23 16:00:56 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd1e8d8f40fd2c75ba8d38c2a337e98ed31c94817

Drivers UI: Add the "Update Dependencies" logic into the callbacks that should be run on every button press

In theory, this should mean that we can get rid of the "Update Dependencies"
button. In practice, there may still be cases where it's still needed
(as somehow, it did end up being needed in the past, even though the RNA
calls should in theory be doing everything needed already).

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

M	source/blender/editors/space_graph/graph_buttons.c

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

diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 3f5cbd166c2..aae370457b7 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -467,7 +467,7 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa)
 
 #define B_IPO_DEPCHANGE     10
 
-static void do_graph_region_driver_buttons(bContext *C, void *UNUSED(arg), int event)
+static void do_graph_region_driver_buttons(bContext *C, void *fcu_v, int event)
 {
 	Main *bmain = CTX_data_main(C);
 	Scene *scene = CTX_data_scene(C);
@@ -475,6 +475,16 @@ static void do_graph_region_driver_buttons(bContext *C, void *UNUSED(arg), int e
 	switch (event) {
 		case B_IPO_DEPCHANGE:
 		{
+			/* force F-Curve & Driver to get re-evaluated (same as the old Update Dependencies) */
+			FCurve *fcu = (FCurve *)fcu_v;
+			ChannelDriver *driver = (fcu) ? fcu->driver : NULL;
+			
+			/* clear invalid flags */
+			if (fcu) {
+				fcu->flag &= ~FCURVE_DISABLED;
+				driver->flag &= ~DRIVER_FLAG_INVALID;
+			}
+			
 			/* rebuild depsgraph for the new deps */
 			DEG_relations_tag_update(bmain);
 			break;



More information about the Bf-blender-cvs mailing list