Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in>2021-11-19 21:34:44 +0300
committerSiddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in>2021-11-19 21:34:44 +0300
commit99a2af76d10e05a18987be5d554ada197b1ca086 (patch)
tree9f9ceccccbd117c05a701b6769eb69055be6a28e /source/blender/blenloader/intern/versioning_userdef.c
parent139606bd370f96e0a8685547d515a2335591d5de (diff)
parent50ad0e15fe0adde7335c89c6fcfa0948c341a08a (diff)
Merge branch 'master' into soc-2021-uv-edge-select-support
Diffstat (limited to 'source/blender/blenloader/intern/versioning_userdef.c')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 4234570af6c..0e5e0b76f43 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -27,8 +27,6 @@
#include "BLI_string.h"
#include "BLI_utildefines.h"
-#include "BLT_translation.h"
-
#include "DNA_anim_types.h"
#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
@@ -51,6 +49,16 @@
#include "wm_event_types.h"
+/* Don't use translation strings in versioning!
+ * These depend on the preferences already being read.
+ * If this is important we can set the translations as part of versioning preferences,
+ * however that should only be done if there are important use-cases. */
+#if 0
+# include "BLT_translation.h"
+#else
+# define N_(msgid) msgid
+#endif
+
/* For versioning we only ever want to manipulate preferences passed in. */
#define U BLI_STATIC_ASSERT(false, "Global 'U' not allowed, only use arguments passed in!")
@@ -313,10 +321,22 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
btheme->space_node.grid_levels = 7;
}
- if (!USER_VERSION_ATLEAST(300, 40)) {
+ if (!USER_VERSION_ATLEAST(300, 41)) {
+ memcpy(btheme, &U_theme_default, sizeof(*btheme));
+ }
+
+ /* Again reset the theme, but only if stored with an early 3.1 alpha version. Some changes were
+ * done in the release branch and then merged into the 3.1 branch (master). So the previous reset
+ * wouldn't work for people who saved their preferences with a 3.1 build meanwhile. But we still
+ * don't want to reset theme changes stored in the eventual 3.0 release once opened in a 3.1
+ * build. */
+ if (userdef->versionfile > 300 && !USER_VERSION_ATLEAST(301, 1)) {
memcpy(btheme, &U_theme_default, sizeof(*btheme));
}
+ if (!USER_VERSION_ATLEAST(301, 2)) {
+ FROM_DEFAULT_V4_UCHAR(space_sequencer.mask);
+ }
/**
* Versioning code until next subversion bump goes here.
*
@@ -692,8 +712,6 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(280, 38)) {
-
- /* (keep this block even if it becomes empty). */
copy_v4_fl4(userdef->light_param[0].vec, -0.580952, 0.228571, 0.781185, 0.0);
copy_v4_fl4(userdef->light_param[0].col, 0.900000, 0.900000, 0.900000, 1.000000);
copy_v4_fl4(userdef->light_param[0].spec, 0.318547, 0.318547, 0.318547, 1.000000);
@@ -726,8 +744,6 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(280, 41)) {
- /* (keep this block even if it becomes empty). */
-
if (userdef->pie_tap_timeout == 0) {
userdef->pie_tap_timeout = 20;
}
@@ -784,7 +800,6 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(280, 62)) {
- /* (keep this block even if it becomes empty). */
if (userdef->vbotimeout == 0) {
userdef->vbocollectrate = 60;
userdef->vbotimeout = 120;
@@ -927,9 +942,13 @@ void blo_do_versions_userdef(UserDef *userdef)
}
if (!USER_VERSION_ATLEAST(300, 40)) {
- /* Rename the default asset library from "Default" to "User Library" */
+ /* Rename the default asset library from "Default" to "User Library". This isn't bullet proof
+ * since it doesn't handle translations and ignores user changes. But this was an alpha build
+ * (experimental) feature and the name is just for display in the UI anyway. So it doesn't have
+ * to work perfectly at all. */
LISTBASE_FOREACH (bUserAssetLibrary *, asset_library, &userdef->asset_libraries) {
- if (STREQ(asset_library->name, DATA_("Default"))) {
+ /* Ignores translations, since that would depend on the current preferences (global `U`). */
+ if (STREQ(asset_library->name, "Default")) {
BKE_preferences_asset_library_name_set(
userdef, asset_library, BKE_PREFS_ASSET_LIBRARY_DEFAULT_NAME);
}