From 659ccd9cd2ee79c462147b53c18ecc8b9faf74a6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 16 Sep 2019 14:52:06 +0200 Subject: Fix T66154: viewlayer hide/exclude settings getting lost for linked collections 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. Differential Revision: https://developer.blender.org/D4416 --- source/blender/blenkernel/intern/library_remap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenkernel/intern/library_remap.c') diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 7554dad5fb0..45dbb4b6ec1 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -497,6 +497,7 @@ static void libblock_remap_data( if (new_id && (new_id->tag & LIB_TAG_INDIRECT) && (r_id_remap_data->status & ID_REMAP_IS_LINKED_DIRECT)) { new_id->tag &= ~LIB_TAG_INDIRECT; + new_id->flag &= ~LIB_INDIRECT_WEAK_LINK; new_id->tag |= LIB_TAG_EXTERN; } -- cgit v1.2.3