LibOverride: Deprecate Proxies: Add auto-conversion on file load.
This commit also add an experimental userPreferences to prevent proxies conversions on file load, and reporting for amount of coverted proxies (and possible issues). Note that potentially linked proxies from other libraries are not hamdled here (this feature seems to be broken anyway in master currently?).
This commit is contained in:
@@ -2283,6 +2283,7 @@ 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),
|
||||
),
|
||||
)
|
||||
|
||||
@@ -344,6 +344,13 @@ 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 (!USER_EXPERIMENTAL_TEST(&U, no_proxy_to_override_conversion)) {
|
||||
BKE_lib_override_library_main_proxy_convert(bmain, reports);
|
||||
}
|
||||
|
||||
bmain->recovered = 0;
|
||||
|
||||
/* startup.blend or recovered startup */
|
||||
|
||||
@@ -1016,7 +1016,7 @@ static void lib_override_library_proxy_convert_do(Main *bmain,
|
||||
if (success) {
|
||||
CLOG_INFO(&LOG,
|
||||
4,
|
||||
"Proxy object '&s' successfuly converted to library overrides",
|
||||
"Proxy object '%s' successfuly converted to library overrides",
|
||||
ob_proxy->id.name);
|
||||
/* Remove the instance empty from this scene, the items now have an overridden collection
|
||||
* instead. */
|
||||
|
||||
@@ -111,8 +111,16 @@ typedef struct BlendFileReadReport {
|
||||
/* Some sub-categories of the above `missing_linked_id` counter. */
|
||||
int missing_obdata;
|
||||
int missing_obproxies;
|
||||
|
||||
/* Number of root override IDs that were resynced. */
|
||||
int resynced_lib_overrides;
|
||||
|
||||
/* Number of (non-converted) linked proxies. */
|
||||
int linked_proxies;
|
||||
/* Number of proxies converted to library overrides. */
|
||||
int proxies_to_lib_overrides_success;
|
||||
/* Number of proxies that failed to convert to library overrides. */
|
||||
int proxies_to_lib_overrides_failures;
|
||||
} count;
|
||||
|
||||
/* Number of libraries which had overrides that needed to be resynced, and a single linked list
|
||||
|
||||
@@ -635,6 +635,7 @@ 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 SANITIZE_AFTER_HERE;
|
||||
/* The following options are automatically sanitized (set to 0)
|
||||
@@ -647,7 +648,7 @@ typedef struct UserDef_Experimental {
|
||||
char use_extended_asset_browser;
|
||||
char use_override_templates;
|
||||
char use_geometry_nodes_fields;
|
||||
char _pad[4];
|
||||
char _pad[3];
|
||||
/** `makesdna` does not allow empty structs. */
|
||||
} UserDef_Experimental;
|
||||
|
||||
|
||||
@@ -6285,6 +6285,13 @@ 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(
|
||||
|
||||
@@ -857,6 +857,20 @@ static void file_read_reports_finalize(BlendFileReadReport *bf_reports)
|
||||
duration_lib_override_recursive_resync_seconds);
|
||||
}
|
||||
|
||||
if (bf_reports->count.linked_proxies != 0 ||
|
||||
bf_reports->count.proxies_to_lib_overrides_success != 0 ||
|
||||
bf_reports->count.proxies_to_lib_overrides_failures != 0) {
|
||||
BKE_reportf(bf_reports->reports,
|
||||
RPT_WARNING,
|
||||
"Proxies are deprecated (%d proxies were automatically converted to library "
|
||||
"overrides, %d proxies could not be converted and %d linked proxies were kept "
|
||||
"untouched). If you need to keep proxies for the time being, please disable the "
|
||||
"`Proxy to Override Auto Conversion` in Experimental user preferences",
|
||||
bf_reports->count.proxies_to_lib_overrides_success,
|
||||
bf_reports->count.proxies_to_lib_overrides_failures,
|
||||
bf_reports->count.linked_proxies);
|
||||
}
|
||||
|
||||
BLI_linklist_free(bf_reports->resynced_lib_overrides_libraries, NULL);
|
||||
bf_reports->resynced_lib_overrides_libraries = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user