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 /source/creator/creator.c | |
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 'source/creator/creator.c')
-rw-r--r-- | source/creator/creator.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 1451a525694..302467c6b3d 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -1639,11 +1639,21 @@ int main(int argc, const char **argv) WM_exit(C); } else { - if ((G.fileflags & G_FILE_AUTOPLAY) && (G.f & G_SCRIPT_AUTOEXEC)) { - if (WM_init_game(C)) - return 0; + if (G.fileflags & G_FILE_AUTOPLAY) { + if (G.f & G_SCRIPT_AUTOEXEC) { + if (WM_init_game(C)) { + return 0; + } + } + else { + if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) { + G.f |= G_SCRIPT_AUTOEXEC_FAIL; + BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Game AutoStart"); + } + } } - else if (!G.file_loaded) { + + if (!G.file_loaded) { WM_init_splash(C); } } |