diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-18 22:11:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-18 22:11:52 +0400 |
commit | 447e9a4cd5d385e8724b7f92c952d66bd35a2c34 (patch) | |
tree | a32a990f805f3d443abe6b078a5b65e6caf65e95 /source/blender/windowmanager/intern/wm_files.c | |
parent | 649dd6f64846ca959566389bc8ce58f87dcb499f (diff) |
add option to enable auto-execute scripts, but exclude certain directories.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index b6aecf120cc..f4b50667b2f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -70,6 +70,7 @@ #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" +#include "BKE_autoexec.h" #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_depsgraph.h" @@ -364,6 +365,21 @@ static int wm_read_exotic(Scene *UNUSED(scene), const char *name) return retval; } +void WM_file_autoexec_init(const char *filepath) +{ + if (G.f & G_SCRIPT_OVERRIDE_PREF) { + return; + } + + if (G.f & G_SCRIPT_AUTOEXEC) { + char path[FILE_MAX]; + BLI_split_dir_part(filepath, path, sizeof(path)); + if (BKE_autoexec_match(path)) { + G.f &= ~G_SCRIPT_AUTOEXEC; + } + } +} + void WM_file_read(bContext *C, const char *filepath, ReportList *reports) { int retval; |