Fix T70875: Library Override: Clicking an Library Overriden Object crashes Blender.

We also need to rebuild the whole collection/viewlayer object cache
thing when we relink an objector collection in a collection (since it
might be part of a view layer).

Again, usual disclaimer about how inneficient this is currently, needs a
serious refactor to only tag caches as dirty, and actually rebuild the
whole thing on access.
This commit is contained in:
Bastien Montagne 2019-11-07 16:09:58 +01:00
parent c37ee984a3
commit 74af698769
Notes: blender-bot 2023-04-14 09:18:04 +02:00
Referenced by issue #71393, Library Override: selection and visibility problem with overriden hook empties
Referenced by issue #71030, Library Override: Lots of operators allow to add objects to overridden collections, which is not currently supported (lost on save)
Referenced by issue #70875, Library Override: Clicking an Library Overriden Object crashes Blender
1 changed files with 4 additions and 1 deletions

View File

@ -677,7 +677,8 @@ void BKE_libblock_relink_ex(
* Maybe we should do a per-ID callback for this instead?
*/
switch (GS(id->name)) {
case ID_SCE: {
case ID_SCE:
case ID_GR: {
if (old_id) {
switch (GS(old_id->name)) {
case ID_OB:
@ -707,6 +708,8 @@ void BKE_libblock_relink_ex(
default:
break;
}
DEG_relations_tag_update(bmain);
}
static int id_relink_to_newid_looper(void *UNUSED(user_data),