From f25c7a3f04ddbc6037cef99e891ba14c820b59f2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Mar 2014 16:56:17 +1300 Subject: More driver linting messages - procedural animation and no-variables for average,etc. Inspired by T39315, this commit adds a few more driver "linting" messages used for providing users with tips on how to use drivers better. This time, we specifically address 2 cases: 1) Drivers being abused for procedural animation, due to the misconception that procedurally generating F-Curves using F-Modifiers means that drivers are needed to wire such procedural motion-sources to properties. 2) Setting up Average/Sum/Min/Max driver types without any input variables - you can't expect anything to happen (unless of course, your intention was to lock the property to 0.0) --- source/blender/editors/space_graph/graph_buttons.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/editors/space_graph') diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 671a4c3afd3..437e3bef0d4 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -671,6 +671,21 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) /* errors? */ if (driver->flag & DRIVER_FLAG_INVALID) uiItemL(col, IFACE_("ERROR: Invalid target channel(s)"), ICON_ERROR); + + /* Warnings about a lack of variables + * NOTE: The lack of variables is generally a bad thing, since it indicates + * that the driver doesn't work at all. This particular scenario arises + * primarily when users mistakenly try to use drivers for procedural + * property animation + */ + if (BLI_listbase_is_empty(&driver->variables)) { + uiItemL(col, IFACE_("ERROR: Driver is useless without any inputs"), ICON_ERROR); + + if (!BLI_listbase_is_empty(&fcu->modifiers)) { + uiItemL(col, IFACE_("TIP: Use F-Curves for procedural animation instead"), ICON_INFO); + uiItemL(col, IFACE_("F-Modifiers can generate curves for those too"), ICON_INFO); + } + } } col = uiLayoutColumn(pa->layout, TRUE); -- cgit v1.2.3