[Bf-blender-cvs] [4d676553485] blender2.8: Drivers UI: Don't show the Copy/Paste driver dvars buttons in the popovers

Joshua Leung noreply at git.blender.org
Mon Jun 11 09:15:55 CEST 2018


Commit: 4d6765534858ee1c1d382430a37fe40d248e37d7
Author: Joshua Leung
Date:   Mon Jun 11 19:10:08 2018 +1200
Branches: blender2.8
https://developer.blender.org/rB4d6765534858ee1c1d382430a37fe40d248e37d7

Drivers UI: Don't show the Copy/Paste driver dvars buttons in the popovers

The copy/paste driver variables buttons currently only work when used in the
Graph Editor as they rely on being able to have the "active F-Curve" context
info that's only present in the Graph Editor (in Drivers Editor mode).
Instead of having them constantly greyed out in the popover, it's easier
to just hide them for now. Besides, this is probably more of an "advanced"
feature that we don't need to expose in the simple UI.

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

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 50a7d5618bc..ee6f6123375 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -747,7 +747,7 @@ static void graph_draw_driven_property_panel(uiLayout *layout, ID *id, FCurve *f
 }
 
 /* UI properties panel layout for driver settings - shared for Drivers Editor and for */
-static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *fcu)
+static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *fcu, const bool is_popover)
 {
 	ChannelDriver *driver = fcu->driver;
 	DriverVar *dvar;
@@ -853,11 +853,14 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f
 		UI_but_func_set(but, driver_add_var_cb, driver, NULL);
 
 		/* copy/paste (as sub-row) */
-		row = uiLayoutRow(row, true);
-		block = uiLayoutGetBlock(row);
+		if (is_popover == false) {
+			/* only in the drivers editor proper for now, as these depend on the active F-Curve */
+			row = uiLayoutRow(row, true);
+			block = uiLayoutGetBlock(row);
 
-		uiItemO(row, "", ICON_COPYDOWN, "GRAPH_OT_driver_variables_copy");
-		uiItemO(row, "", ICON_PASTEDOWN, "GRAPH_OT_driver_variables_paste");
+			uiItemO(row, "", ICON_COPYDOWN, "GRAPH_OT_driver_variables_copy");
+			uiItemO(row, "", ICON_PASTEDOWN, "GRAPH_OT_driver_variables_paste");
+		}
 	}
 
 	/* loop over targets, drawing them */
@@ -985,7 +988,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
 	if (!graph_panel_context(C, &ale, &fcu))
 		return;
 
-	graph_draw_driver_settings_panel(pa->layout, ale->id, fcu);
+	graph_draw_driver_settings_panel(pa->layout, ale->id, fcu, false);
 
 	/* cleanup */
 	MEM_freeN(ale);
@@ -1039,7 +1042,7 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *pa)
 
 			/* Drivers Settings */
 			uiItemL(layout, IFACE_("Driver Settings:"), ICON_NONE);
-			graph_draw_driver_settings_panel(pa->layout, id, fcu);
+			graph_draw_driver_settings_panel(pa->layout, id, fcu, true);
 		}
 	}



More information about the Bf-blender-cvs mailing list