Added global checks to popup and then launch individual checks

0.5.1
This commit is contained in:
pullusb
2025-07-23 14:30:44 +02:00
parent c33eab6f32
commit 373ed201d3
5 changed files with 84 additions and 39 deletions
+10 -2
View File
@@ -345,6 +345,14 @@ def get_collection_children_recursive(col, cols=None) -> list:
cols = get_collection_children_recursive(sub, cols)
return cols
def get_viewlayer_collections_with_visiblity_conflict(context):
'''return viewlayer collections with visibility conflicts between hide in viewlayer, hide viewport and hide render'''
vcols = get_collection_children_recursive(context.view_layer.layer_collection)
vcols = list(set(vcols)) # ensure no duplicates
## Store collection with conflicts
return [vc for vc in vcols if not (vc.hide_viewport == vc.collection.hide_viewport == vc.collection.hide_render)]
class RT_OT_list_collection_visibility_conflicts(Operator):
bl_idname = "rt.list_collection_visibility_conflicts"
bl_label = "List Collection Visibility Conflicts"
@@ -364,12 +372,12 @@ class RT_OT_list_collection_visibility_conflicts(Operator):
def invoke(self, context, event):
## get all viewlayer collections
self.conflict_collections = get_viewlayer_collections_with_visiblity_conflict(context)
vcols = get_collection_children_recursive(context.view_layer.layer_collection)
vcols = list(set(vcols)) # ensure no duplicates
## Store collection with conflicts
# layer_collection.is_visible against render visibility ?
## Do not list currently excluded collections
self.conflict_collections = [vc for vc in vcols if not (vc.hide_viewport == vc.collection.hide_viewport == vc.collection.hide_render)]
self.included_collection = [vc for vc in self.conflict_collections if not vc.exclude]
self.excluded_collection = [vc for vc in self.conflict_collections if vc.exclude]