diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-06-11 10:10:08 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-06-11 10:15:05 +0300 |
commit | 4d6765534858ee1c1d382430a37fe40d248e37d7 (patch) | |
tree | fd7b0120e7f806d711c13669e2d0bc558f6decc4 /source | |
parent | d7373f6c4952c112d20108c21712e0f69f8afbb3 (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 17 |
1 files changed, 10 insertions, 7 deletions
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); } } |