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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-02 06:45:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-02 06:45:42 +0300
commit99b8eef6a534c2c9846b48736cb9eb007c120ec7 (patch)
tree4e036c62c46c9ccd805506165e9b7fcfa13b551b
parentd46c910b1a105287bccccd651056a9a0a73b3936 (diff)
BKE_global: clear deprecated flags on load (all of them)
-rw-r--r--source/blender/blenkernel/BKE_global.h8
-rw-r--r--source/blender/blenkernel/intern/blendfile.c1
-rw-r--r--source/blender/windowmanager/intern/wm_files.c1
3 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 17baab1f579..045fc772426 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -107,8 +107,9 @@ typedef struct Global {
/** #Global.f */
enum {
G_FLAG_RENDER_VIEWPORT = (1 << 0),
- G_FLAG_BACKBUFSEL = (1 << 4),
- G_FLAG_PICKSEL = (1 << 5),
+ G_FLAG_BACKBUFSEL = (1 << 1),
+ G_FLAG_PICKSEL = (1 << 2),
+
G_FLAG_SCRIPT_AUTOEXEC = (1 << 13),
/** When this flag is set ignore the prefs #USER_SCRIPT_AUTOEXEC_DISABLE. */
G_FLAG_SCRIPT_OVERRIDE_PREF = (1 << 14),
@@ -120,6 +121,9 @@ enum {
#define G_FLAG_ALL_RUNTIME \
(G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF)
+/** Flags to read from blend file. */
+#define G_FLAG_ALL_READFILE 0
+
/** #Global.debug */
enum {
G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 075d05eebe8..fb03dc6963e 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -292,6 +292,7 @@ static void setup_app_data(
/* special cases, override loaded flags: */
if (G.f != bfd->globalf) {
const int flags_keep = G_FLAG_ALL_RUNTIME;
+ bfd->globalf &= G_FLAG_ALL_READFILE;
bfd->globalf = (bfd->globalf & ~flags_keep) | (G.f & flags_keep);
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 224a4cd597e..f4062c5296e 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -616,6 +616,7 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports)
* need to re-enable it here else drivers + registered scripts wont work. */
if (G.f != G_f_orig) {
const int flags_keep = G_FLAG_ALL_RUNTIME;
+ G.f &= G_FLAG_ALL_READFILE;
G.f = (G.f & ~flags_keep) | (G_f_orig & flags_keep);
}