diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-03-22 07:56:17 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-03-22 07:56:17 +0400 |
commit | f25c7a3f04ddbc6037cef99e891ba14c820b59f2 (patch) | |
tree | 7c2998a1f52995f59ee82d5ab737c8ea2c9d69e4 /source/blender/editors/space_graph | |
parent | 4acb57a7a7cf33fb1c6cae01ee1965074ec23c45 (diff) |
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)
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 15 |
1 files changed, 15 insertions, 0 deletions
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); |