From 9bfcbe95059f378e9d820e71e600bba4a8e2a5cb Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 2 Oct 2007 00:43:35 +0000 Subject: Action Editor - Sliders Bugfix: The Action Editor slider callbacks were missing depsgraph update calls, so the 3d-view wasn't correctly updated after using to sliders to add keyframes --- source/blender/src/drawaction.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'source/blender/src/drawaction.c') diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index b6f13f76426..8a9841ce70d 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -61,7 +61,9 @@ #include "DNA_key_types.h" #include "BKE_action.h" +#include "BKE_depsgraph.h" #include "BKE_ipo.h" +#include "BKE_key.h" #include "BKE_global.h" #include "BKE_utildefines.h" @@ -69,6 +71,7 @@ #include "BIF_editaction.h" #include "BIF_editkey.h" +#include "BIF_editnla.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" #include "BIF_gl.h" @@ -197,23 +200,32 @@ static void icu_slider_func(void *voidicu, void *voidignore) /* create the bezier triple if one doesn't exist, * otherwise modify it's value */ - if (!bezt) { + if (bezt == NULL) { insert_vert_icu(icu, cfra, icu->curval, 0); } else { bezt->vec[1][1] = icu->curval; } - /* make sure the Ipo's are properly process and + /* make sure the Ipo's are properly processed and * redraw as necessary */ sort_time_ipocurve(icu); testhandles_ipocurve(icu); - allqueue (REDRAWVIEW3D, 0); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWNLA, 0); - allqueue (REDRAWIPO, 0); + /* nla-update (in case this affects anything) */ + synchronize_action_strips(); + + /* do redraw pushes, and also the depsgraph flushes */ + if (OBACT->pose || ob_get_key(OBACT)) + DAG_object_flush_update(G.scene, OBACT, OB_RECALC); + else + DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB); + + allqueue(REDRAWVIEW3D, 0); + allqueue(REDRAWACTION, 0); + allqueue(REDRAWNLA, 0); + allqueue(REDRAWIPO, 0); allspace(REMAKEIPO, 0); allqueue(REDRAWBUTSALL, 0); } -- cgit v1.2.3