[Bf-blender-cvs] [a3ad55b346e] blender2.8: Drivers UI: Get rid of dedicated button to remove active driver

Joshua Leung noreply at git.blender.org
Wed May 23 16:32:59 CEST 2018


Commit: a3ad55b346efae356dc4b86bc520d3d1b1215a32
Author: Joshua Leung
Date:   Wed May 23 15:59:15 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa3ad55b346efae356dc4b86bc520d3d1b1215a32

Drivers UI: Get rid of dedicated button to remove active driver

There are multiple other ways to do it. Leaving this here just made it
easy (and dangerous) to accidentally remove the driver, and was causing
other problems with other layouts.

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

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 d7905a0c2d9..3f5cbd166c2 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -485,23 +485,6 @@ static void do_graph_region_driver_buttons(bContext *C, void *UNUSED(arg), int e
 	WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene); // XXX could use better notifier
 }
 
-/* callback to remove the active driver */
-static void driver_remove_cb(bContext *C, void *ale_v, void *UNUSED(arg))
-{
-	bAnimListElem *ale = (bAnimListElem *)ale_v;
-	ID *id = ale->id;
-	FCurve *fcu = ale->data;
-	ReportList *reports = CTX_wm_reports(C);
-	
-	/* try to get F-Curve that driver lives on, and ID block which has this AnimData */
-	if (ELEM(NULL, id, fcu))
-		return;
-	
-	/* 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 *C, void *driver_v, void *UNUSED(arg))
 {
@@ -798,12 +781,6 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
 	               TIP_("Force updates of dependencies"));
 	UI_but_func_set(but, driver_update_flags_cb, fcu, NULL);
 
-	but = uiDefIconTextBut(block, UI_BTYPE_BUT, B_IPO_DEPCHANGE, ICON_X, "",
-	               0, 0, UI_UNIT_X, UI_UNIT_Y,
-	               NULL, 0.0, 0.0, 0, 0,
-	               TIP_("Remove this driver"));
-	UI_but_funcN_set(but, driver_remove_cb, MEM_dupallocN(ale), NULL);
-		
 	/* driver-level settings - type, expressions, and errors */
 	RNA_pointer_create(ale->id, &RNA_Driver, driver, &driver_ptr);



More information about the Bf-blender-cvs mailing list