mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
Fix bug when casting to tessellation for invalid IFCs which don't use material sets properly.
This commit is contained in:
@@ -272,7 +272,8 @@ class UpdateRepresentation(bpy.types.Operator, Operator):
|
|||||||
if self.ifc_representation_class == "IfcTessellatedFaceSet":
|
if self.ifc_representation_class == "IfcTessellatedFaceSet":
|
||||||
# We are explicitly casting to a tessellation, so remove all parametric materials.
|
# We are explicitly casting to a tessellation, so remove all parametric materials.
|
||||||
element_type = ifcopenshell.util.element.get_type(product)
|
element_type = ifcopenshell.util.element.get_type(product)
|
||||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type)
|
if element_type: # Some invalid IFCs use material sets without a type.
|
||||||
|
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type)
|
||||||
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=product)
|
ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=product)
|
||||||
else:
|
else:
|
||||||
# These objects are parametrically based on an axis and should not be modified as a mesh
|
# These objects are parametrically based on an axis and should not be modified as a mesh
|
||||||
|
|||||||
Reference in New Issue
Block a user