Fix #100786: Collection hide viewport in properties tab

Similar to other visibility properties, include "hide_viewport" in
collection properties tab. One issue is that, when collection is
disabled, automatically parent collection is selected or tab is gone
when parent collection does not exist. The check was added in
0a903e7ab1, it doesn't seem very useful so
removed that.

Pull Request: https://projects.blender.org/blender/blender/pulls/132107
This commit is contained in:
Pratik Borhade
2025-01-10 14:49:43 +01:00
committed by Pratik Borhade
parent b9ec08b551
commit 06a2617107
2 changed files with 2 additions and 4 deletions

View File

@@ -42,6 +42,7 @@ class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel):
col = layout.column(align=True)
col.prop(collection, "hide_select", text="Selectable", toggle=False, invert_checkbox=True)
col.prop(collection, "hide_viewport", toggle=False)
col.prop(collection, "hide_render", toggle=False)
col = layout.column(align=True)

View File

@@ -1419,10 +1419,7 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer)
/* Always set a valid active collection. */
LayerCollection *active = view_layer->active_collection;
if (active && layer_collection_hidden(view_layer, active)) {
BKE_layer_collection_activate_parent(view_layer, active);
}
else if (active == nullptr) {
if (active == nullptr) {
view_layer->active_collection = static_cast<LayerCollection *>(
view_layer->layer_collections.first);
}