diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 04:42:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-10 04:42:16 +0400 |
commit | 412c04347440fa5e480b69a07b20ff1399775c5b (patch) | |
tree | 6fa2ac672fdf61006bce6fa17ccc30bdcae2442f /release/scripts | |
parent | e7a487d1e9e79176a0ca99cda3882aac4ea16a99 (diff) |
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.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/space_info.py | 11 |
1 files changed, 11 insertions, 0 deletions
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) |