diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-09-24 17:48:49 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-09-24 20:25:42 +0300 |
commit | 3142ae19d22767507ec190ff39c89210ac96c39d (patch) | |
tree | 84ecb91c86c5a4d5bcbbcb375f53b5d2d30bda7e /source/blender | |
parent | 9dced206dd52d743625f39354ca9ce07f7e05563 (diff) |
Fix T70080: Newly created objects not visible with local collections
The tricky part here is to support a hidden parent and a "visible" child
collection. In this case the object should obviously be invisible. It is
all working now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 984e94c05c9..9b18052ef1e 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -654,7 +654,8 @@ static short layer_collection_sync(ViewLayer *view_layer, ListBase *new_object_bases, short parent_exclude, short parent_restrict, - short parent_layer_restrict) + short parent_layer_restrict, + unsigned short parent_local_collections_bits) { /* TODO: support recovery after removal of intermediate collections, reordering, .. * For local edits we can make editing operating do the appropriate thing, but for @@ -700,6 +701,9 @@ static short layer_collection_sync(ViewLayer *view_layer, lc->flag = parent_exclude; } + unsigned short local_collections_bits = parent_local_collections_bits & + lc->local_collections_bits; + /* 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); @@ -719,7 +723,8 @@ static short layer_collection_sync(ViewLayer *view_layer, new_object_bases, lc->flag, child_restrict, - child_layer_restrict); + child_layer_restrict, + local_collections_bits); /* Layer collection exclude is not inherited. */ if (lc->flag & LAYER_COLLECTION_EXCLUDE) { @@ -760,6 +765,7 @@ static short layer_collection_sync(ViewLayer *view_layer, else { /* Create new base. */ base = object_base_new(cob->ob); + base->local_collections_bits = local_collections_bits; *base_p = base; BLI_addtail(new_object_bases, base); } @@ -837,7 +843,8 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) &new_object_bases, parent_exclude, parent_restrict, - parent_layer_restrict); + parent_layer_restrict, + ~(0)); /* Any remaining object bases are to be removed. */ for (Base *base = view_layer->object_bases.first; base; base = base->next) { |