[Bf-blender-cvs] [20a8edaa725] blender-v2.90-release: No experimental feature (but debug ones) to work for blender beta/release

Dalai Felinto noreply at git.blender.org
Tue Aug 18 14:03:37 CEST 2020


Commit: 20a8edaa725ddbae16179d2f7cea88c097c61615
Author: Dalai Felinto
Date:   Mon Aug 17 19:50:35 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB20a8edaa725ddbae16179d2f7cea88c097c61615

No experimental feature (but debug ones) to work for blender beta/release

Final releases (including beta) should strictly show features that are
finalized to prevent loss of data, old API clanging around, and the
overall quality of the product (Blender) presented.

Note that rendering should never be affected by user preferences, so
this is only changing things in the UI level.

Development note: This is reset experimental UI on file load.
Also note: to hide RNA (needed for hair and particles) will be done as a
separate patch.

Differential Revision: https://developer.blender.org/D8606

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/intern/blender.c
M	source/blender/blenloader/BLO_readfile.h
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/editors/interface/interface.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 03f85578b6e..9548de20752 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2118,6 +2118,10 @@ class ExperimentalPanel:
 
     url_prefix = "https://developer.blender.org/"
 
+    @classmethod
+    def poll(cls, context):
+        return bpy.app.version_cycle == 'alpha'
+
     def _draw_items(self, context, items):
         prefs = context.preferences
         experimental = prefs.experimental
@@ -2178,6 +2182,12 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
 class USERPREF_PT_experimental_debugging(ExperimentalPanel, Panel):
     bl_label = "Debugging"
 
+    @classmethod
+    def poll(cls, context):
+        # Unlike the other experimental panels, the debugging one is always visible
+        # even in beta or release.
+        return True
+
     def draw(self, context):
         self._draw_items(
             context, (
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 3df09d08814..c340e1f1ff7 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -50,6 +50,9 @@ extern "C" {
 /** User readable version string. */
 const char *BKE_blender_version_string(void);
 
+/* Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */
+bool BKE_blender_version_is_alpha(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index e8aa13a8beb..af502d30145 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -135,6 +135,12 @@ const char *BKE_blender_version_string(void)
   return blender_version_string;
 }
 
+bool BKE_blender_version_is_alpha(void)
+{
+  static bool is_alpha = STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha");
+  return is_alpha;
+}
+
 void BKE_blender_globals_init(void)
 {
   blender_version_init();
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index 97c77ed2e19..580c833d8dc 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -186,6 +186,9 @@ void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_
 /* Version patch user preferences. */
 void BLO_version_defaults_userpref_blend(struct Main *mainvar, struct UserDef *userdef);
 
+/* Disable unwanted experimental feature settings on startup. */
+void BLO_sanitize_experimental_features_userpref_blend(struct UserDef *userdef);
+
 struct BlendThumbnail *BLO_thumbnail_from_file(const char *filepath);
 
 /* datafiles (generated theme) */
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index 50e3b375166..ec631eb64f3 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -38,6 +38,7 @@
 #include "DNA_windowmanager_types.h"
 
 #include "BKE_addon.h"
+#include "BKE_blender_version.h"
 #include "BKE_colorband.h"
 #include "BKE_idprop.h"
 #include "BKE_keyconfig.h"
@@ -784,4 +785,23 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
 #undef USER_VERSION_ATLEAST
 }
 
+void BLO_sanitize_experimental_features_userpref_blend(UserDef *userdef)
+{
+  /* User preference experimental settings are only supported in alpha builds.
+   * This prevents users corrupting data and relying on API that may change.
+   *
+   * If user preferences are saved this will be stored in disk as expected.
+   * This only starts to take effect when there is a release branch (on beta).
+   *
+   * At that time master already has its version bumped so its user preferences
+   * are not touched by these settings. */
+
+  if (BKE_blender_version_is_alpha()) {
+    return;
+  }
+  userdef->experimental.use_new_particle_system = false;
+  userdef->experimental.use_new_hair_type = false;
+  userdef->experimental.use_sculpt_vertex_colors = false;
+}
+
 #undef USER_LMOUSESELECT
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 286cb1571bd..d19c677efb4 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -44,6 +44,8 @@
 
 #include "BLI_utildefines.h"
 
+#include "BLO_readfile.h"
+
 #include "BKE_animsys.h"
 #include "BKE_context.h"
 #include "BKE_idprop.h"
@@ -6818,6 +6820,8 @@ void UI_init_userdef(Main *bmain)
   /* fix saved themes */
   init_userdef_do_versions(bmain);
   uiStyleInit();
+
+  BLO_sanitize_experimental_features_userpref_blend(&U);
 }
 
 void UI_reinit_font(void)



More information about the Bf-blender-cvs mailing list