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)
This commit is contained in:
Joshua Leung 2014-03-22 16:56:17 +13:00
parent 4acb57a7a7
commit f25c7a3f04

@ -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);