bugfix: work on a copy of the object list to prevent error

hiding/unhinding while interating on objects can void an object, giving back None), because Blender's cached object list is invalidated
This commit is contained in:
Pullusb
2026-09-30 15:59:19 +02:00
parent d650ec8c98
commit c2073d7c11
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -103,7 +103,9 @@ def outliner_conform(apply=False, context=None):
affected_items['collections'][vlc] = col_attrs
if affect_target in {'ALL', 'OBJECT'}:
for obj in ref_collection.all_objects:
## Iterate on a copy: changing visibility can invalidate all_objects cache while iterating
## (iteration then yields None and stops early)
for obj in list(ref_collection.all_objects):
obj_attrs = []
if conform_selectability and obj.hide_select != ref_collection.hide_select:
if apply: obj.hide_select = ref_collection.hide_select