minor changes to the script auto-execution based on Brecht's suggestions.
[blender.git] / source / blender / python / intern / bpy_driver.c
index e7c0b7b88115b585c611cb30b2b28468f75a3d5f..481758db2526bcf61d03db3b6d6476ef9723f862 100644 (file)
@@ -180,7 +180,7 @@ float BPY_driver_exec(ChannelDriver *driver, const float evaltime)
 
        DriverVar *dvar;
        double result = 0.0; /* default return */
-       char *expr = NULL;
+       const char *expr;
        short targets_ok = 1;
        int i;
 
@@ -192,9 +192,9 @@ float BPY_driver_exec(ChannelDriver *driver, const float evaltime)
        if (!(G.f & G_SCRIPT_AUTOEXEC)) {
                if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
                        G.f |= G_SCRIPT_AUTOEXEC_FAIL;
-                       BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Driver '%s'", driver->expression);
+                       BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Driver '%s'", expr);
 
-                       printf("skipping driver '%s', automatic scripts are disabled\n", driver->expression);
+                       printf("skipping driver '%s', automatic scripts are disabled\n", expr);
                }
                return 0.0f;
        }