mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Texture support is now compatible with glTF texture maps
This commit is contained in:
@@ -29,9 +29,11 @@ class Usecase:
|
||||
def execute(self):
|
||||
styled_items = set()
|
||||
presentation_layer_assignments = set()
|
||||
textures = set()
|
||||
for subelement in self.file.traverse(self.settings["representation"]):
|
||||
if subelement.is_a("IfcRepresentationItem") and subelement.StyledByItem:
|
||||
[styled_items.add(s) for s in subelement.StyledByItem]
|
||||
if subelement.is_a("IfcRepresentationItem"):
|
||||
[styled_items.add(s) for s in subelement.StyledByItem or []]
|
||||
[textures.add(t) for t in getattr(subelement, "HasTextures", []) or []]
|
||||
elif subelement.is_a("IfcRepresentation"):
|
||||
for inverse in self.file.get_inverse(subelement):
|
||||
if inverse.is_a("IfcPresentationLayerAssignment"):
|
||||
@@ -44,6 +46,9 @@ class Usecase:
|
||||
do_not_delete=self.file.by_type("IfcGeometricRepresentationContext"),
|
||||
)
|
||||
|
||||
for texture in textures:
|
||||
ifcopenshell.util.element.remove_deep2(self.file, texture)
|
||||
|
||||
for element in styled_items:
|
||||
if not element.Item:
|
||||
self.file.remove(element)
|
||||
|
||||
Reference in New Issue
Block a user