BKE_global: clear deprecated flags on load (all of them)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 2 Feb 2019 03:45:42 +0000 (14:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 2 Feb 2019 03:45:42 +0000 (14:45 +1100)
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/intern/blendfile.c
source/blender/windowmanager/intern/wm_files.c

index 17baab1..045fc77 100644 (file)
@@ -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 */
index 075d05e..fb03dc6 100644 (file)
@@ -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);
        }
 
index 224a4cd..f4062c5 100644 (file)
@@ -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);
                }