purge unused material to try to purge materials recursively #3914

As on first iteration it may remove only unused material sets and on the next iteration it will be able to remove IfcMaterials that were not used anywhere else besides those material sets.
This commit is contained in:
Andrej730
2024-09-13 14:15:20 +05:00
parent 4d149e8a78
commit 80af847f99
+5
View File
@@ -413,4 +413,9 @@ class Material(bonsai.core.tool.Material):
continue
ifcopenshell.api.material.remove_material(ifc_file, material)
i += 1
if i == 0:
return 0
i += cls.purge_unused_materials()
return i