[Bf-blender-cvs] [f25c7a3] master: More driver linting messages - procedural animation and no-variables for average, etc.
Joshua Leung
noreply at git.blender.org
Sat Mar 22 05:01:02 CET 2014
Commit: f25c7a3f04ddbc6037cef99e891ba14c820b59f2
Author: Joshua Leung
Date: Sat Mar 22 16:56:17 2014 +1300
https://developer.blender.org/rBf25c7a3f04ddbc6037cef99e891ba14c820b59f2
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)
===================================================================
M source/blender/editors/space_graph/graph_buttons.c
===================================================================
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 671a4c3..437e3be 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);
More information about the Bf-blender-cvs
mailing list