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>2018-05-23 17:00:56 +0300
committerJoshua Leung <aligorith@gmail.com>2018-05-23 17:32:46 +0300
commitd1e8d8f40fd2c75ba8d38c2a337e98ed31c94817 (patch)
treed847bc332a08855156e941d4e72de44e266d5543 /source/blender/editors/space_graph
parenta3ad55b346efae356dc4b86bc520d3d1b1215a32 (diff)
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).
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c12
1 files changed, 11 insertions, 1 deletions
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;