Cleanup: clear deprecated flags
authorCampbell Barton <ideasman42@gmail.com>
Thu, 7 Feb 2019 22:29:08 +0000 (09:29 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 7 Feb 2019 22:31:59 +0000 (09:31 +1100)
source/blender/blenkernel/BKE_blender_version.h
source/blender/blenloader/intern/versioning_260.c
source/blender/blenloader/intern/versioning_280.c
source/blender/blenloader/intern/versioning_userdef.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h

index 469274eb36a6a99cf9aaa47762a2d9bee97a21f1..75c98bc6c6af897ced15d2459eb0c2d0c4877759 100644 (file)
@@ -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
index 3b50817c65ea000c26531b22f45f36ac9a8ef546..4d76728dfa67d4f46409a3a2e9062bc0aca67769 100644 (file)
@@ -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;
 
index 1510b339c98ddeae6407c01d302a73ceb270d4ff..92e908ad5229745009db4d2bfa7e137b225bad99 100644 (file)
@@ -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. */
+
        }
 }
index 72e4e2d0fe10f3f4bcc34c1c2591d3ffa72c0201..f3443d36540261cd152d6e101e63ab400644a9e5 100644 (file)
@@ -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.
         */
index b994a688f8696053dd2250919541207f2ac6693b..cf580e093fdae47ea65106b8ac9df66a95f059a7 100644 (file)
@@ -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);
 
index d5b096d004a978dff7e9d1ed206166e4bff2ce86..e1819fcb226937f34c2a6b5e916555c253d3dc77 100644 (file)
@@ -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)
 
index 29b0dae275d9f1fea4b81cf452dd5c5e894dee71..b90a3d896033ef3a2163acbc3898c59fefd27124 100644 (file)
@@ -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;