minor changes to the script auto-execution based on Brecht's suggestions.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jun 2013 00:10:56 +0000 (00:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 12 Jun 2013 00:10:56 +0000 (00:10 +0000)
release/scripts/startup/bl_ui/space_info.py
source/blender/python/intern/bpy_driver.c
source/blender/python/intern/bpy_interface.c

index 7487aaf420d4ff4540909f57b26518a3480ef492..5d476c01b082bb1a744fa6d8806d11a707beaef2 100644 (file)
@@ -67,14 +67,13 @@ class INFO_HT_header(Header):
 
         if bpy.app.autoexec_fail is True and bpy.app.autoexec_fail_quiet is False:
             layout.operator_context = 'EXEC_DEFAULT'
-            row.label("Script failed to auto-run", icon='ERROR')
+            row.label("Auto-run disabled: %s" % bpy.app.autoexec_fail_message, icon='ERROR')
             if bpy.data.is_saved:
                 props = row.operator("wm.open_mainfile", icon='SCREEN_BACK', text="Reload Trusted")
                 props.filepath = bpy.data.filepath
                 props.use_scripts = True
 
-            row.operator("script.autoexec_warn_clear", icon='CANCEL')
-            row.label("Skipping: (%s)" % bpy.app.autoexec_fail_message)
+            row.operator("script.autoexec_warn_clear", text="Ignore")
             return
 
         row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
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;
        }
index 79f856344d31129e2a2ce09bfb65e9613d2c513e..feffea205530169c17e002427117f3ad4a3127a9 100644 (file)
@@ -731,7 +731,7 @@ void BPY_modules_load_user(bContext *C)
                        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), "Register Text '%s'", text->id.name + 2);
+                                       BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Text '%s'", text->id.name + 2);
 
                                        printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2);
                                }