Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
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;