[Bf-blender-cvs] [99b8eef6a53] master: BKE_global: clear deprecated flags on load (all of them)

Campbell Barton noreply at git.blender.org
Sat Feb 2 04:44:42 CET 2019


Commit: 99b8eef6a534c2c9846b48736cb9eb007c120ec7
Author: Campbell Barton
Date:   Sat Feb 2 14:45:42 2019 +1100
Branches: master
https://developer.blender.org/rB99b8eef6a534c2c9846b48736cb9eb007c120ec7

BKE_global: clear deprecated flags on load (all of them)

===================================================================

M	source/blender/blenkernel/BKE_global.h
M	source/blender/blenkernel/intern/blendfile.c
M	source/blender/windowmanager/intern/wm_files.c

===================================================================

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);
 		}



More information about the Bf-blender-cvs mailing list