diff options
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index f3c0d5da6ee..4198e6ded9c 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -32,6 +32,7 @@ #include "BKE_freestyle.h" #include "BKE_idprop.h" #include "BKE_layer.h" +#include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" #include "BKE_object.h" @@ -698,6 +699,10 @@ static short layer_collection_sync(ViewLayer *view_layer, lc->flag = parent_exclude; } + /* Tag linked collection as a weak reference so we keep the layer + * collection pointer on file load and remember exclude state. */ + id_lib_indirect_weak_link(&collection->id); + /* Collection restrict is inherited. */ short child_restrict = parent_restrict; short child_layer_restrict = parent_layer_restrict; @@ -735,6 +740,10 @@ static short layer_collection_sync(ViewLayer *view_layer, continue; } + /* Tag linked object as a weak reference so we keep the object + * base pointer on file load and remember hidden state. */ + id_lib_indirect_weak_link(&cob->ob->id); + void **base_p; Base *base; if (BLI_ghash_ensure_p(view_layer->object_bases_hash, cob->ob, &base_p)) { |