From 412c04347440fa5e480b69a07b20ff1399775c5b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Jun 2013 00:42:16 +0000 Subject: Python script auto-execution changes: - script execution is off by default - if a blend file attempts to execute a script this shows a message in the header with the action that was suppressed (script/driver/game-autostart) and 2 buttons to either reload the file trusted, or to ignore the message. - the file selector will always default to use the trust setting in the user preferences, but reloading an open file will keep using the current setting (whatever was set before or set on the command-line). - added SCons setting WITH_BF_PYTHON_SECURITY, this sets the default state for the user prefereces not to trust blend files on load. ... this option was in CMake before, but always off, now its enabled by default for SCons and CMake, and forced on in CMake for now. --- release/scripts/startup/bl_ui/space_info.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 4ea366e3541..1885f115aa8 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -64,6 +64,17 @@ class INFO_HT_header(Header): layout.template_reports_banner() row = layout.row(align=True) + + 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') + 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) + return + row.operator("wm.splash", text="", icon='BLENDER', emboss=False) row.label(text=scene.statistics(), translate=False) -- cgit v1.2.3