From fa51f02be3254db81bcf004d9e50e5ce86da16c6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 12 Jun 2013 00:10:56 +0000 Subject: minor changes to the script auto-execution based on Brecht's suggestions. --- release/scripts/startup/bl_ui/space_info.py | 5 ++--- source/blender/python/intern/bpy_driver.c | 6 +++--- source/blender/python/intern/bpy_interface.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 7487aaf420d..5d476c01b08 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -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) diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index e7c0b7b8811..481758db252 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -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; } diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 79f856344d3..feffea20553 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -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); } -- cgit v1.2.3