[Bf-blender-cvs] [829d93ff069] master: Remove option to not auto-convert proxies on file load.

Bastien Montagne noreply at git.blender.org
Wed Feb 2 10:23:55 CET 2022


Commit: 829d93ff069c02d205cfc9e294efa9d2210e1ff8
Author: Bastien Montagne
Date:   Tue Feb 1 16:51:53 2022 +0100
Branches: master
https://developer.blender.org/rB829d93ff069c02d205cfc9e294efa9d2210e1ff8

Remove option to not auto-convert proxies on file load.

Now all proxies will always be converted to library overrides. If
conversion fails, they are simply 'disabled'.

This should be the last 'user-visible' step of proxies removal.
Remaining upcoming commits will remove internal ID management, depsgraph
and evaluation code related to proxies.

Also bump the blendfile subversion.

Part of T91671.

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/intern/blendfile.c
M	source/blender/blenkernel/intern/blendfile_link_append.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 0548486c786..78ef68e0bab 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2316,7 +2316,6 @@ class USERPREF_PT_experimental_debugging(ExperimentalPanel, Panel):
             context, (
                 ({"property": "use_undo_legacy"}, "T60695"),
                 ({"property": "override_auto_resync"}, "T83811"),
-                ({"property": "proxy_to_override_auto_conversion"}, "T91671"),
                 ({"property": "use_cycles_debug"}, None),
                 ({"property": "use_geometry_nodes_legacy"}, "T91274"),
                 ({"property": "show_asset_debug_info"}, None),
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 091f9784697..645d049fe71 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,7 @@ extern "C" {
 
 /* Blender file format version. */
 #define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 0
+#define BLENDER_FILE_SUBVERSION 1
 
 /* Minimum Blender version that supports reading file written with the current
  * version. Older Blender versions will test this and show a warning if the file
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 6ae19c8036f..819f786a2d0 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -78,6 +78,23 @@
 /** \name High Level `.blend` file read/write.
  * \{ */
 
+static bool blendfile_or_libraries_versions_atleast(Main *bmain,
+                                                    const short versionfile,
+                                                    const short subversionfile)
+{
+  if (!MAIN_VERSION_ATLEAST(bmain, versionfile, subversionfile)) {
+    return false;
+  }
+
+  LISTBASE_FOREACH (Library *, library, &bmain->libraries) {
+    if (!MAIN_VERSION_ATLEAST(library, versionfile, subversionfile)) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
 static bool foreach_path_clean_cb(BPathForeachPathData *UNUSED(bpath_data),
                                   char *path_dst,
                                   const char *path_src)
@@ -349,10 +366,11 @@ static void setup_app_data(bContext *C,
     do_versions_ipos_to_animato(bmain);
   }
 
-  /* FIXME: Same as above, readfile's `do_version` do not allow to create new IDs. */
-  /* TODO: Once this is definitively validated for 3.0 and option to not do it is removed, add a
-   * version bump and check here. */
-  if (mode != LOAD_UNDO && !USER_EXPERIMENTAL_TEST(&U, no_proxy_to_override_conversion)) {
+  /* NOTE: readfile's `do_version` does not allow to create new IDs, and only operates on a single
+   * library at a time. This code needs to operate on the whole Main at once. */
+  /* NOTE: Check bmain version (i.e. current blend file version), AND the versions of all the
+   * linked libraries. */
+  if (mode != LOAD_UNDO && !blendfile_or_libraries_versions_atleast(bmain, 302, 1)) {
     BKE_lib_override_library_main_proxy_convert(bmain, reports);
   }
 
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c
index 4149821b67b..94d14b63437 100644
--- a/source/blender/blenkernel/intern/blendfile_link_append.c
+++ b/source/blender/blenkernel/intern/blendfile_link_append.c
@@ -995,6 +995,9 @@ static int foreach_libblock_link_append_callback(LibraryIDLinkCallbackData *cb_d
 
 static void blendfile_link_append_proxies_convert(Main *bmain, ReportList *reports)
 {
+  /* NOTE: Do not bother checking file versions here, if there are no proxies to convert this code
+   * is quite fast anyway. */
+
   BlendFileReadReport bf_reports = {.reports = reports};
   BKE_lib_override_library_main_proxy_convert(bmain, &bf_reports);
 
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 15bb1ef920d..637dd216935 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -651,7 +651,6 @@ typedef struct UserDef_Experimental {
   /* Debug options, always available. */
   char use_undo_legacy;
   char no_override_auto_resync;
-  char no_proxy_to_override_conversion;
   char use_cycles_debug;
   char use_geometry_nodes_legacy;
   char show_asset_debug_info;
@@ -666,7 +665,7 @@ typedef struct UserDef_Experimental {
   char use_sculpt_tools_tilt;
   char use_extended_asset_browser;
   char use_override_templates;
-  char _pad[1];
+  char _pad[2];
   /** `makesdna` does not allow empty structs. */
 } UserDef_Experimental;
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 4379b4ebe1d..aef219c4236 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6386,13 +6386,6 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
       "Enable library overrides automatic resync detection and process on file load. Disable when "
       "dealing with older .blend files that need manual Resync (Enforce) handling");
 
-  prop = RNA_def_property(srna, "proxy_to_override_auto_conversion", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_negative_sdna(prop, NULL, "no_proxy_to_override_conversion", 1);
-  RNA_def_property_ui_text(
-      prop,
-      "Proxy to Override Auto Conversion",
-      "Enable automatic conversion of proxies to library overrides on file load");
-
   prop = RNA_def_property(srna, "use_new_point_cloud_type", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "use_new_point_cloud_type", 1);
   RNA_def_property_ui_text(



More information about the Bf-blender-cvs mailing list