The problem was that the object and collection pointers in Base and
LayerCollection would get lost of file read. Normally such ID pointers would
be resolved by pointing to an ID_ID placeholder which has the datablock name,
and then replacing it will the real datablock. However ID_ID is only written
for directly linked datablocks.
This adds the concept of an indirectly linked datablock with a weak reference
to it. For this we write an ID_ID_WEAK_REF code, which is a reference that
will only be resolved if the datablock was read for another reason.
I'm not really happy with this, but I couldn't find a better solution. For
the studio this is an important feature, as it allows them to link in
collections to shots and then change their view layer visibility as if it
was local data. Except that without this fix it would not be saved.
Depends on D4415.