Fix crash related to liboverride differential operations code.

Root of the issue is how we generate the storage ID for the differential
override operations.

However, since those are disabled anyway currently, simply comment out
creation of this copy for now, we can revisit this if/when we decide to
re-activate differential overrides.

Related to T81059, found while investigating it.
This commit is contained in:
Bastien Montagne 2020-09-24 18:12:11 +02:00
parent 244cef6f00
commit bdbe95578d
Notes: blender-bot 2023-02-14 03:44:41 +01:00
Referenced by issue #81059, Resync Library Override: Crash when linked file is modified
1 changed files with 11 additions and 0 deletions

View File

@ -1825,6 +1825,14 @@ ID *BKE_lib_override_library_operations_store_start(Main *bmain,
TIMEIT_START_AVERAGED(BKE_lib_override_library_operations_store_start);
#endif
/* This is fully disabled for now, as it generated very hard to solve issues with Collections and
* how they reference each-other in their parents/children relations.
* Core of the issue is creating and storing those copies in a separate BMain, while collection
* copy code re-assign blindly parents/children, even if they do not belong to the same BMain.
* One solution could be to implement special flag as discussed below, and prevent any
* other-ID-reference creation/update in that case (since no differential operation is expected
* to involve those anyway). */
#if 0
/* XXX TODO We may also want a specialized handling of things here too, to avoid copying heavy
* never-overridable data (like Mesh geometry etc.)? And also maybe avoid lib
* reference-counting completely (shallow copy...). */
@ -1846,6 +1854,9 @@ ID *BKE_lib_override_library_operations_store_start(Main *bmain,
storage_id = NULL;
}
}
#else
storage_id = NULL;
#endif
local->override_library->storage = storage_id;