[Bf-blender-cvs] [e60560bda03] master: Fix T76738: Duplicate brushes cause assertion on undo

Campbell Barton noreply at git.blender.org
Fri May 15 09:53:45 CEST 2020


Commit: e60560bda03dd59fa91d9b36fa9dcea36cfdd8c0
Author: Campbell Barton
Date:   Fri May 15 17:53:03 2020 +1000
Branches: master
https://developer.blender.org/rBe60560bda03dd59fa91d9b36fa9dcea36cfdd8c0

Fix T76738: Duplicate brushes cause assertion on undo

Changes for 2.90 versioning.

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

M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/versioning_290.c

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

diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 852549f22d4..5510f3c3d2e 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -31,7 +31,7 @@ extern "C" {
  * \note Use #STRINGIFY() rather than defining with quotes.
  */
 #define BLENDER_VERSION 290
-#define BLENDER_SUBVERSION 1
+#define BLENDER_SUBVERSION 2
 /** 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_280.c b/source/blender/blenloader/intern/versioning_280.c
index b6d53aee618..07551f3ea2b 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -5194,16 +5194,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
   }
 
-  /** Repair files from duplicate brushes added to blend files, see: T76738. */
-  if (!MAIN_VERSION_ATLEAST(bmain, 283, 17) ||
-      ((bmain->versionfile == 290) && !MAIN_VERSION_ATLEAST(bmain, 290, 2))) {
-    short id_codes[] = {ID_BR, ID_PAL};
-    for (int i = 0; i < ARRAY_SIZE(id_codes); i++) {
-      ListBase *lb = which_libbase(bmain, id_codes[i]);
-      BKE_main_id_repair_duplicate_names_listbase(lb);
-    }
-  }
-
   /**
    * Versioning code until next subversion bump goes here.
    *
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 40f6689e43b..3b7e7c21b28 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -29,6 +29,7 @@
 
 #include "BKE_collection.h"
 #include "BKE_colortools.h"
+#include "BKE_lib_id.h"
 #include "BKE_main.h"
 
 #include "BLO_readfile.h"
@@ -40,17 +41,16 @@
 void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
 {
   UNUSED_VARS(fd);
-  /**
-   * Versioning code until next subversion bump goes here.
-   *
-   * \note Be sure to check when bumping the version:
-   * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
-   * - "versioning_userdef.c", #do_versions_theme
-   *
-   * \note Keep this message at the bottom of the function.
-   */
-  {
-    /* Keep this block, even when empty. */
+
+  /** Repair files from duplicate brushes added to blend files, see: T76738. */
+  if (!MAIN_VERSION_ATLEAST(bmain, 290, 2)) {
+    {
+      short id_codes[] = {ID_BR, ID_PAL};
+      for (int i = 0; i < ARRAY_SIZE(id_codes); i++) {
+        ListBase *lb = which_libbase(bmain, id_codes[i]);
+        BKE_main_id_repair_duplicate_names_listbase(lb);
+      }
+    }
 
     if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "float", "uv_opacity")) {
       for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
@@ -84,4 +84,17 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
       }
     }
   }
+
+  /**
+   * Versioning code until next subversion bump goes here.
+   *
+   * \note Be sure to check when bumping the version:
+   * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
+   * - "versioning_userdef.c", #do_versions_theme
+   *
+   * \note Keep this message at the bottom of the function.
+   */
+  {
+    /* Keep this block, even when empty. */
+  }
 }



More information about the Bf-blender-cvs mailing list