Fix #130579: Un-isolating collection fails in presence of linked-collection

Visibility of linked collection cannot be changed after 4e907829d3 and
e494a44024. This results in failing "un-isolate" collection. To resolve
that, treat linked/overridden collections as isolated by returning true in
`outliner_collection_is_isolated()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/130604
This commit is contained in:
Pratik Borhade
2024-11-24 06:59:40 +01:00
committed by Pratik Borhade
parent 8dc8e48e9a
commit f181262634

View File

@@ -433,7 +433,7 @@ static bool outliner_collection_is_isolated(Scene *scene,
const LayerCollection *layer_collection_cmp,
const Collection *collection_cmp,
const bool value_cmp,
const PropertyRNA *layer_or_collection_prop,
PropertyRNA *layer_or_collection_prop,
LayerCollection *layer_collection,
Collection *collection)
{
@@ -444,6 +444,12 @@ static bool outliner_collection_is_isolated(Scene *scene,
const Collection *collection_ensure_cmp = collection_cmp ? collection_cmp :
layer_collection_cmp->collection;
/* Exclude linked collections, otherwise toggling property won't reset the visibility for
* editable collections, see: #130579. */
if (layer_or_collection_prop && !RNA_property_editable(&ptr, layer_or_collection_prop)) {
return true;
}
if (collection_ensure->flag & COLLECTION_IS_MASTER) {
}
else if (collection_ensure == collection_ensure_cmp) {