[Bf-blender-cvs] [62bff153775] master: Fix various Blender 3.0 versioning issues

Ray Molenkamp noreply at git.blender.org
Fri Apr 16 03:25:09 CEST 2021


Commit: 62bff15377510ce05543afb40526d430a21697f1
Author: Ray Molenkamp
Date:   Fri Apr 16 11:17:23 2021 +1000
Branches: master
https://developer.blender.org/rB62bff15377510ce05543afb40526d430a21697f1

Fix various Blender 3.0 versioning issues

This changes the following items:

- package name is now `blender-3.0.0-git.09eb04c0a865-windows64`
  rather than `blender-3.00.0-git.09eb04c0a865-windows64`
- Fix version resource for blender.exe not building
- Data directories are now `3.0\...` rather than `3.00\....`
- User prefs are now in:
  `c:\Users\users\AppData\Roaming\Blender Foundation\Blender\3.0\`
  rather than:
  `c:\Users\users\AppData\Roaming\Blender Foundation\Blender\3.00\`
- Updating startup & preferences from previous release
  has a special exception for 3.0 to check for 3.93 and older.

See T87532

Ref D10986

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

M	build_files/buildbot/buildbot_utils.py
M	build_files/cmake/macros.cmake
M	release/scripts/startup/bl_operators/userpref.py
M	source/blender/blenkernel/intern/appdir.c
M	source/creator/CMakeLists.txt
M	source/creator/creator_intern.h

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

diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index 057c2155fb6..7e9858d9268 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -85,8 +85,8 @@ class VersionInfo:
         version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
         version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH'))
         version_numbers = (version_number // 100, version_number % 100, version_number_patch)
-        self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1])
-        self.version = "%d.%02d.%d" % version_numbers
+        self.short_version = "%d.%d" % (version_numbers[0], version_numbers[1])
+        self.version = "%d.%d.%d" % version_numbers
         self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
         self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
 
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 91881441c95..813ac013cdf 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -923,10 +923,6 @@ function(get_blender_version)
   math(EXPR _out_version_major "${_out_version} / 100")
   math(EXPR _out_version_minor "${_out_version} % 100")
 
-  # Zero pad the minor version so `_out_version_minor` is always two characters.
-  # This is needed if the minor version is a single digit.
-  string(REGEX REPLACE "^([0-9])$" "0\\1" _out_version_minor "${_out_version_minor}")
-
   # output vars
   set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
   set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 7547184dc04..f77f00d2234 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -99,6 +99,15 @@ class PREFERENCES_OT_copy_prev(Operator):
         version = bpy.app.version
         version_new = ((version[0] * 100) + version[1])
         version_old = ((version[0] * 100) + version[1]) - 1
+
+        # Special case, remove when the version is > 3.0.
+        if version_new == 300:
+            version_new = 294
+            version_old = 293
+        else:
+            print("TODO: remove exception!")
+        # End special case.
+
         # Ensure we only try to copy files from a point release.
         # The check below ensures the second numbers match.
         while (version_new % 100) // 10 == (version_old % 100) // 10:
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 1075a46e72b..bcfd34ab42f 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -137,7 +137,7 @@ static char *blender_version_decimal(const int version)
 {
   static char version_str[5];
   BLI_assert(version < 1000);
-  BLI_snprintf(version_str, sizeof(version_str), "%d.%02d", version / 100, version % 100);
+  BLI_snprintf(version_str, sizeof(version_str), "%d.%d", version / 100, version % 100);
   return version_str;
 }
 
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index cb5fc538e69..f1741c3b495 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -130,14 +130,11 @@ set(SRC
 
 # MSVC 2010 gives linking errors with the manifest
 if(WIN32 AND NOT UNIX)
-  string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
-  string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
-  string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
   add_definitions(
     -DBLEN_VER_RC_STR="${BLENDER_VERSION}"
-    -DBLEN_VER_RC_1=${bver1}
-    -DBLEN_VER_RC_2=${bver2}
-    -DBLEN_VER_RC_3=${bver3}
+    -DBLEN_VER_RC_1=${BLENDER_VERSION_MAJOR}
+    -DBLEN_VER_RC_2=${BLENDER_VERSION_MINOR}
+    -DBLEN_VER_RC_3=${BLENDER_VERSION_PATCH}
     -DBLEN_VER_RC_4=0
   )
 
diff --git a/source/creator/creator_intern.h b/source/creator/creator_intern.h
index bcc8a15355a..2260da8db11 100644
--- a/source/creator/creator_intern.h
+++ b/source/creator/creator_intern.h
@@ -72,7 +72,7 @@ enum {
 
 /* for the callbacks: */
 #ifndef WITH_PYTHON_MODULE
-#  define BLEND_VERSION_FMT "Blender %d.%02d.%d"
+#  define BLEND_VERSION_FMT "Blender %d.%d.%d"
 #  define BLEND_VERSION_ARG (BLENDER_VERSION / 100), (BLENDER_VERSION % 100), BLENDER_VERSION_PATCH
 #endif



More information about the Bf-blender-cvs mailing list