Page MenuHome

Fix Various versioning issues
ClosedPublic

Authored by Ray Molenkamp (LazyDodo) on Apr 15 2021, 7:33 PM.

Details

Summary

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\

did i miss anything?

Diff Detail

Repository
rB Blender
Branch
tmp_blender_version (branched from master)
Build Status
Buildable 14067
Build 14067: arc lint + arc unit

Event Timeline

Ray Molenkamp (LazyDodo) requested review of this revision.Apr 15 2021, 7:33 PM
Ray Molenkamp (LazyDodo) created this revision.
Ray Molenkamp (LazyDodo) planned changes to this revision.Apr 15 2021, 7:40 PM

breaks with blender 3.1

Oh... that's a nasty can of worms....

Ray Molenkamp (LazyDodo) requested review of this revision.Apr 15 2021, 8:10 PM

the BLENDER_VERSION triple encoding the version as an integer is just a source of problems, this will get us through 3.0 with no issues, but 3.1 will bite us in the rear, but we have enough time to make a plan there, doesn't have to be solved today.

Thanks Ray.
Did you check if opening 3.0 for the first time allows users to import settings from previous Blenders?

@Simon Thommes (simonthommes) told me earlier that with the 3.00 folder he didn't have this option when he opened his (self) build of Blender. Not sure if related to the 3.00 issue, but assuming it is.

And to be clear I don't expect we do address the issues that may come from people using/saving short-lived 3.00 settings. I'm referring to 2.9X -> 3.0 transition only.

Doesn't work, it's looking for the blender 2.99 folder to copy the settings from, it's managed in python and I'll be honest, me and python are not friends. I managed to bolt on an eye sore that'll make it work, but someone smarter than me can/should probably do better here

 release/scripts/startup/bl_operators/userpref.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 7547184dc04..245cee5c9b4 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -98,7 +98,11 @@ class PREFERENCES_OT_copy_prev(Operator):
         import os
         version = bpy.app.version
         version_new = ((version[0] * 100) + version[1])
-        version_old = ((version[0] * 100) + version[1]) - 1
+        if version_new == 300:
+            version_new = 294
+            version_old = 293
+        else:
+            version_old = ((version[0] * 100) + version[1]) - 1
         # 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:

Thinking about 3.1. I think it would be more future proof to use 301 for it. In case we decide to do an eventual 3.9, 3.10, 3.11 releases

Thinking about 3.1. I think it would be more future proof to use 301 for it. In case we decide to do an eventual 3.9, 3.10, 3.11 releases

Hmmm... I think future-proof - enabling you to have versions like 3.11 - would mean keeping the minor digit you've asked to remove.

This patch misses some other instances of the minor version being formatted with two numbers.

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/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 7547184dc04..573f5cff7fe 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -99,6 +99,14 @@ 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
+
+        # 3.0 one-time exception.
+        if version[:2] == (3, 0):
+            return (2, 93)
+        elif version[:2] > (3, 0):
+            print("Developer note: remove this check!")
+        # End 3.0 exception.
+
         # 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/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

Account for changes

This revision is now accepted and ready to land.Apr 16 2021, 3:26 AM