diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-18 20:18:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-20 13:35:25 +0300 |
commit | 5e968a996a5397a14d00c49e67c74b993859a1d6 (patch) | |
tree | 3ba545b2085c16e5ed33ce868003915f07e3454b /source/blender/blenkernel/intern/layer.c | |
parent | 0619f960c2999873ed2e9a24a1f5d77eac03e64d (diff) |
Objects: restore per object restrict view/render/select.
Note this is now separate from H key hiding, and meant for more persistent
ways to define which objects are relevant to the viewport or render.
This avoids some cases where you'd have to create collection specifically
to hide objects for viewport/render.
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 090be7e0fe5..84915e628df 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -647,14 +647,24 @@ static void layer_collection_sync( BLI_ghash_insert(view_layer->object_bases_hash, base->object, base); } - if ((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) { + int object_restrict = base->object->restrictflag; + + if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) && + ((object_restrict & OB_RESTRICT_VIEW) == 0)) + { base->flag |= BASE_VISIBLED | BASE_VISIBLE_VIEWPORT; - if ((child_restrict & COLLECTION_RESTRICT_SELECT) == 0) { + if (((child_restrict & COLLECTION_RESTRICT_SELECT) == 0) && + ((object_restrict & OB_RESTRICT_SELECT) == 0)) + { base->flag |= BASE_SELECTABLED; } } - if ((child_restrict & COLLECTION_RESTRICT_RENDER) == 0) { + + if (((child_restrict & COLLECTION_RESTRICT_RENDER) == 0) && + ((object_restrict & OB_RESTRICT_RENDER) == 0)) + + { base->flag |= BASE_VISIBLE_RENDER; } |