Blender Git Loki

Git Commits -> Revision 9afa738

Revision 9afa738 by Bastien Montagne (master)
April 23, 2021, 12:34 (GMT)
Fix bug/crash in ID bulk deletion code.

This is complex situation. Tagged ID deletion (used to delete several
data-blocks at once) removes IDs to be deleted from Main.

But when we remove deleted IDs' usages of other IDs (using
`BKE_libblock_relink_ex`), some specific post-process is required on
some types, like Collections. Those post-processes would in some cases
rely on data actually being in Main.

That failing condition would lead in existing code on missing processing
the very ID (collection) we were working on, leading to missing removing
some child collection pointers, leading to the crash (later on in
LayerCollection resync process).

For now we go with an optimization & fix that avoids processing all
collections in Main when we actually know which one we are working one
(case of `BKE_libblock_relink_ex`, but not of
`BKE_libblock_remap_locked`).

This is however yet another demonstration of the need to rework that
whole collection/layer resync process, since it is not only extremely
inneficient currently, but it also requires valid Main/ID state way too
deep into the remapping code.

NOTE: This fix may very well not catch/address all possible fail cases
here, dealing with the double parent/child relationships of collections
is challenging...

Issue reported by @eyecandy from the studio, thanks.

Commit Details:

Full Hash: 9afa738542881cf69aa89fd893351200324c107f
Parent Commit: 5441f5f
Lines Changed: +43, -25

3 Modified Paths:

/source/blender/blenkernel/BKE_collection.h (+3, -1) (Diff)
/source/blender/blenkernel/intern/collection.c (+29, -20) (Diff)
/source/blender/blenkernel/intern/lib_remap.c (+11, -4) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021