From 58082beda937b05cb2aa42e4f9f0b801a3e8663d Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 25 Sep 2010 14:32:26 +0000 Subject: Fix #23847: keyframe insert on button not working in popup menus, e.g. the vector popup for node inputs. --- source/blender/editors/animation/drivers.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/animation/drivers.c') diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 9b776fc0859..898d7db89fc 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -372,7 +372,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); - uiAnimContextProperty(C, &ptr, &prop, &index); + uiContextActiveProperty(C, &ptr, &prop, &index); if (all) index= -1; @@ -389,6 +389,8 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ + uiContextAnimUpdate(C); + DAG_ids_flush_update(CTX_data_main(C), 0); WM_event_add_notifier(C, NC_ANIMATION|ND_FCURVES_ORDER, NULL); // XXX @@ -427,7 +429,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op) /* try to find driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); - uiAnimContextProperty(C, &ptr, &prop, &index); + uiContextActiveProperty(C, &ptr, &prop, &index); if (all) index= -1; @@ -440,6 +442,8 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op) if (success) { /* send updates */ + uiContextAnimUpdate(C); + DAG_ids_flush_update(CTX_data_main(C), 0); WM_event_add_notifier(C, NC_ANIMATION|ND_FCURVES_ORDER, NULL); // XXX @@ -478,7 +482,7 @@ static int copy_driver_button_exec (bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); - uiAnimContextProperty(C, &ptr, &prop, &index); + uiContextActiveProperty(C, &ptr, &prop, &index); if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { path= RNA_path_from_ID_to_property(&ptr, prop); @@ -486,6 +490,8 @@ static int copy_driver_button_exec (bContext *C, wmOperator *op) if (path) { /* only copy the driver for the button that this was involved for */ success= ANIM_copy_driver(ptr.id.data, path, index, 0); + + uiContextAnimUpdate(C); MEM_freeN(path); } @@ -522,7 +528,7 @@ static int paste_driver_button_exec (bContext *C, wmOperator *op) /* try to create driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); - uiAnimContextProperty(C, &ptr, &prop, &index); + uiContextActiveProperty(C, &ptr, &prop, &index); if (ptr.id.data && ptr.data && prop && RNA_property_animateable(&ptr, prop)) { path= RNA_path_from_ID_to_property(&ptr, prop); @@ -530,6 +536,8 @@ static int paste_driver_button_exec (bContext *C, wmOperator *op) if (path) { /* only copy the driver for the button that this was involved for */ success= ANIM_paste_driver(ptr.id.data, path, index, 0); + + uiContextAnimUpdate(C); MEM_freeN(path); } -- cgit v1.2.3