Use utilities to fetch collection hierarchy

I don't think this offers a noticeable performance gain but feels more idiomatic since it is available with the API.
This commit is contained in:
Gorgious56
2025-04-17 09:10:28 +02:00
committed by GitHub
parent 5a6476a57f
commit 1999216ea5
@@ -927,16 +927,7 @@ class OverrideOutlinerDelete(bpy.types.Operator):
return {"FINISHED"}
def get_collection_objects_and_children(self, collection: bpy.types.Collection) -> dict[str, Any]:
objects = set()
children = set()
queue = [collection]
while queue:
collection = queue.pop()
for obj in collection.objects:
objects.add(obj)
queue.extend(collection.children)
children = children.union(collection.children)
return {"objects": objects, "children": children}
return {"objects": set(collection.all_objects), "children": set(collection.children_recursive)}
def rollback(self, data):
tool.Ifc.set(data["old_file"])