[Bf-blender-cvs] [261d42cd843] master: Cleanup: clear deprecated flags

Campbell Barton noreply at git.blender.org
Thu Feb 7 23:32:10 CET 2019


Commit: 261d42cd843d4eba82170193ccaea960cd4376b8
Author: Campbell Barton
Date:   Fri Feb 8 09:29:08 2019 +1100
Branches: master
https://developer.blender.org/rB261d42cd843d4eba82170193ccaea960cd4376b8

Cleanup: clear deprecated flags

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

M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesdna/DNA_userdef_types.h

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

diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 469274eb36a..75c98bc6c6a 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -23,7 +23,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         280
-#define BLENDER_SUBVERSION      43
+#define BLENDER_SUBVERSION      44
 /* Several breakages with 280, e.g. collections vs layers */
 #define BLENDER_MINVERSION      280
 #define BLENDER_MINSUBVERSION   0
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 3b50817c65e..4d76728dfa6 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -2394,6 +2394,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
 					SCULPT_SYMM_X = (1 << 0),
 					SCULPT_SYMM_Y = (1 << 1),
 					SCULPT_SYMM_Z = (1 << 2),
+					SCULPT_SYMMETRY_FEATHER = (1 << 6),
 				};
 				int symmetry_flags = sd->flags & 7;
 
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 1510b339c98..92e908ad522 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2787,13 +2787,33 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 		BKE_main_id_repair_duplicate_names_listbase(lb);
 	}
 
-	{
-		/* Versioning code until next subversion bump goes here. */
-
+	if (!MAIN_VERSION_ATLEAST(bmain, 280, 44)) {
 		if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "a")) {
 			for (Material *mat = bmain->mat.first; mat; mat = mat->id.next) {
 				mat->a = 1.0f;
 			}
 		}
+
+		for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
+			enum {
+				R_ALPHAKEY = 2,
+			};
+			scene->rd.seq_flag &= ~(
+			        R_SEQ_DEPRECATED_0 |
+			        R_SEQ_DEPRECATED_1 |
+			        R_SEQ_DEPRECATED_2);
+			scene->rd.color_mgt_flag &= ~R_COLOR_MANAGEMENT_DEPRECATED_1;
+			if (scene->rd.alphamode == R_ALPHAKEY) {
+				scene->rd.alphamode = R_ADDSKY;
+			}
+			ToolSettings *ts = scene->toolsettings;
+			ts->particle &= ~PE_DEPRECATED_6;
+			ts->sculpt->flags &= ~SCULPT_FLAG_DEPRECATED_6;
+		}
+	}
+
+	{
+		/* Versioning code until next subversion bump goes here. */
+
 	}
 }
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 72e4e2d0fe1..f3443d36540 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -468,6 +468,15 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
 		}
 	}
 
+	if (!USER_VERSION_ATLEAST(280, 44)) {
+		userdef->flag &= ~(
+		        USER_FLAG_DEPRECATED_0 | USER_FLAG_DEPRECATED_1);
+		userdef->uiflag2 &= ~(
+		        USER_UIFLAG2_DEPRECATED_0);
+		userdef->gp_settings &= ~(
+		        GP_PAINT_DEPRECATED_0);
+	}
+
 	/**
 	 * Include next version bump.
 	 */
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index b994a688f86..cf580e093fd 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -4094,7 +4094,7 @@ void sculpt_cache_calc_brushdata_symm(
 	/* XXX This reduces the length of the grab delta if it approaches the line of symmetry
 	 * XXX However, a different approach appears to be needed */
 #if 0
-	if (sd->paint.symmetry_flags & SCULPT_SYMMETRY_FEATHER) {
+	if (sd->paint.symmetry_flags & PAINT_SYMMETRY_FEATHER) {
 		float frac = 1.0f / max_overlap_count(sd);
 		float reduce = (feather - frac) / (1 - frac);
 
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index d5b096d004a..e1819fcb226 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -663,8 +663,8 @@ typedef struct RenderData {
 	int mode;
 
 	/**
-	 * What to do with the sky/background. Picks sky/premul/key
-	 * blending for the background
+	 * What to do with the sky/background.
+	 * Picks sky/premul blending for the background.
 	 */
 	short alphamode;
 
@@ -1828,8 +1828,9 @@ typedef struct Scene {
 
 /* RenderData.seq_flag */
 enum {
-	// R_SEQ_GL_PREV = (1 << 1),  // UNUSED, we just use setting from seq_prev_type now.
-	// R_SEQ_GL_REND = (1 << 2),  // UNUSED, opengl render has its own operator now.
+	R_SEQ_DEPRECATED_0 = (1 << 0),  /* cleared */
+	R_SEQ_DEPRECATED_1 = (1 << 1),  /* cleared */
+	R_SEQ_DEPRECATED_3 = (1 << 2),  /* cleared */
 	R_SEQ_SOLID_TEX  = (1 << 3),
 	R_SEQ_CAMERA_DOF = (1 << 4),
 };
@@ -1899,16 +1900,15 @@ enum {
                      R_STAMP_RENDERTIME|R_STAMP_CAMERALENS|R_STAMP_MEMORY|                 \
                      R_STAMP_HIDE_LABELS|R_STAMP_FRAME_RANGE|R_STAMP_HOSTNAME)
 
-/* RenderData.alphamode */
+/** #RenderData.alphamode */
 #define R_ADDSKY		0
 #define R_ALPHAPREMUL	1
-/*#define R_ALPHAKEY		2*/ /* deprecated, shouldn't be used */
 
 /* RenderData.color_mgt_flag */
 enum {
 	/** deprecated, should only be used in versioning code only */
 	R_COLOR_MANAGEMENT              = (1 << 0),
-	/*R_COLOR_MANAGEMENT_PREDIVIDE    = (1 << 1)*/  /* deprecated, shouldn't be used */
+	R_COLOR_MANAGEMENT_DEPRECATED_1 = (1 << 1),
 };
 
 #ifdef DNA_DEPRECATED
@@ -2192,8 +2192,7 @@ typedef enum eSculptFlags {
 	SCULPT_LOCK_Y = (1 << 4),
 	SCULPT_LOCK_Z = (1 << 5),
 
-	/* deprecated, part of paint struct symmetry_flags now */
-	SCULPT_SYMMETRY_FEATHER = (1 << 6),
+	SCULPT_FLAG_DEPRECATED_6 = (1 << 6),  /* cleared */
 
 	SCULPT_USE_OPENMP = (1 << 7),
 	SCULPT_ONLY_DEFORM = (1 << 8),
@@ -2359,7 +2358,7 @@ typedef enum eGPencil_Guide_Reference {
 #define PE_DEFLECT_EMITTER      (1 << 2)
 #define PE_INTERPOLATE_ADDED    (1 << 3)
 #define PE_DRAW_PART            (1 << 4)
-/* #define PE_X_MIRROR          (1 << 6) */ /* deprecated */
+#define PE_DEPRECATED_6         (1 << 6)  /* cleared */
 #define PE_FADE_TIME            (1 << 7)
 #define PE_AUTO_VELOCITY        (1 << 8)
 
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 29b0dae275d..b90a3d89603 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -252,12 +252,6 @@ typedef struct ThemeSpace {
 	/** Region background. */
 	char execution_buts[4];
 
-	/* float panel */
-/*	char panel[4];			unused */
-/*	char panel_title[4];	unused */
-/*	char panel_text[4];		unused */
-/*	char panel_text_hi[4];	unused */
-
 	/* note, cannot use name 'panel' because of DNA mapping old files */
 	uiPanelColors panelcolors;
 
@@ -865,7 +859,8 @@ typedef enum eWalkNavigation_Flag {
 
 /** #UserDef.uiflag */
 typedef enum eUserpref_UI_Flag {
-	/* flags 0 and 1 were old flags (for autokeying) that aren't used anymore */
+	USER_UIFLAG_DEPRECATED_0    = (1 << 0),  /* cleared */
+	USER_UIFLAG_DEPRECATED_1    = (1 << 1),  /* cleared */
 	USER_WHEELZOOMDIR           = (1 << 2),
 	USER_FILTERFILEEXTS         = (1 << 3),
 	USER_DRAWVIEWINFO           = (1 << 4),
@@ -901,7 +896,7 @@ typedef enum eUserpref_UI_Flag {
 
 /** #UserDef.uiflag2 */
 typedef enum eUserpref_UI_Flag2 {
-	// USER_FLAG2_DEPRECATED = (1 << 0),  /* TODO: clear */
+	USER_UIFLAG2_DEPRECATED_0   = (1 << 0),
 	USER_REGION_OVERLAP			= (1 << 1),
 	USER_TRACKPAD_NATURAL		= (1 << 2),
 } eUserpref_UI_Flag2;
@@ -1005,7 +1000,7 @@ typedef enum eText_Draw_Options {
 /** Grease Pencil Settings.
  * #UserDef.gp_settings */
 typedef enum eGP_UserdefSettings {
-	// GP_PAINT_DOSMOOTH		    = (1 << 0),  /* UNUSED */
+	GP_PAINT_DEPRECATED_0       = (1 << 0),
 	GP_PAINT_DOSIMPLIFY		    = (1 << 1),
 } eGP_UserdefSettings;



More information about the Bf-blender-cvs mailing list