[Bf-blender-cvs] [d2b03d23647] master: Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button

Joshua Leung noreply at git.blender.org
Sun Nov 19 15:06:22 CET 2017


Commit: d2b03d23647197f933d7afdeb53da35ed074bf94
Author: Joshua Leung
Date:   Mon Nov 20 03:06:13 2017 +1300
Branches: master
https://developer.blender.org/rBd2b03d23647197f933d7afdeb53da35ed074bf94

Fix: Undo pushes were missing for Add/Remove Driver Variable buttons, and Remove Driver button

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

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 985cca7c4af..df6bd01144d 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -64,6 +64,7 @@
 #include "ED_anim_api.h"
 #include "ED_keyframing.h"
 #include "ED_screen.h"
+#include "ED_util.h"
 
 #include "UI_interface.h"
 #include "UI_resources.h"
@@ -503,25 +504,28 @@ static void driver_remove_cb(bContext *C, void *ale_v, void *UNUSED(arg))
 	
 	/* call API method to remove this driver  */
 	ANIM_remove_driver(reports, id, fcu->rna_path, fcu->array_index, 0);
+	ED_undo_push(C, "Remove Driver");
 }
 
 /* callback to add a target variable to the active driver */
-static void driver_add_var_cb(bContext *UNUSED(C), void *driver_v, void *UNUSED(arg))
+static void driver_add_var_cb(bContext *C, void *driver_v, void *UNUSED(arg))
 {
 	ChannelDriver *driver = (ChannelDriver *)driver_v;
 	
 	/* add a new variable */
 	driver_add_new_variable(driver);
+	ED_undo_push(C, "Add Driver Variable");
 }
 
 /* callback to remove target variable from active driver */
-static void driver_delete_var_cb(bContext *UNUSED(C), void *driver_v, void *dvar_v)
+static void driver_delete_var_cb(bContext *C, void *driver_v, void *dvar_v)
 {
 	ChannelDriver *driver = (ChannelDriver *)driver_v;
 	DriverVar *dvar = (DriverVar *)dvar_v;
 	
 	/* remove the active variable */
 	driver_free_variable_ex(driver, dvar);
+	ED_undo_push(C, "Delete Driver Variable");
 }
 
 /* callback to report why a driver variable is invalid */



More information about the Bf-blender-cvs mailing list