mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user