From 4de6a210c69fe254518ca8d6c860782c54f03749 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 28 Nov 2018 00:49:36 -0200 Subject: Per view-layer collection visibility We still control this in the viewport collections visibility menu. But now we are actually changing the visibility of the collections, not of the objects. If a collection is indirectly invisible (because one of its parents are invisible) we gray it out. Also if you click directly in the collection names, it "isolates" the collection by hiding all collections, and showing the direct parents and all the children of the selected collection. Development Note: Right now I'm excluding the hidden collections from the depsgraph. Thus the need for tagging relations to update. If this proves to be too slow, we can change. --- source/blender/editors/screen/screen_context.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/screen/screen_context.c') diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index cb7d4f1fee9..df7eb07c4d0 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -203,6 +203,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { continue; } + if ((base->flag & BASE_VISIBLE) == 0) { + continue; + } if ((base->flag & BASE_SELECTED) != 0) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } @@ -218,6 +221,9 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { continue; } + if ((base->flag & BASE_VISIBLE) == 0) { + continue; + } if ((base->flag & BASE_SELECTED) != 0) { if (0 == BKE_object_is_libdata(base->object)) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); -- cgit v1.2.3