From 4d6765534858ee1c1d382430a37fe40d248e37d7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 11 Jun 2018 19:10:08 +1200 Subject: 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. --- source/blender/editors/space_graph/graph_buttons.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'source') 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); } } -- cgit v1.2.3