From 910d1ff2666a3abd66228bc2ac1654dcd3ee00e3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 11 Aug 2013 08:29:56 +0000 Subject: display an error with python driver expressions when script execution is disabled. --- source/blender/editors/space_graph/graph_buttons.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to '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 93a68be164a..295f8bd9ff2 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -50,6 +50,7 @@ #include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_main.h" +#include "BKE_global.h" #include "BKE_screen.h" #include "BKE_unit.h" @@ -620,8 +621,12 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) uiItemR(col, &driver_ptr, "expression", 0, IFACE_("Expr"), ICON_NONE); /* errors? */ - if (driver->flag & DRIVER_FLAG_INVALID) + if ((G.f & G_SCRIPT_AUTOEXEC) == 0) { + uiItemL(col, IFACE_("ERROR: Python auto-execution disabled"), ICON_ERROR); + } + else if (driver->flag & DRIVER_FLAG_INVALID) { uiItemL(col, IFACE_("ERROR: Invalid Python expression"), ICON_ERROR); + } } else { /* errors? */ -- cgit v1.2.3