From fcbb28f9d8d42210c8c45d88c2cf17d19d909620 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 22 Aug 2023 17:32:29 +1000 Subject: [PATCH] When you force an object to be a tessellation, automatically remove all parametric constraints for you. --- .../blenderbim/bim/module/geometry/operator.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/geometry/operator.py b/src/blenderbim/blenderbim/bim/module/geometry/operator.py index 21d9922cd1..c4ee14f969 100644 --- a/src/blenderbim/blenderbim/bim/module/geometry/operator.py +++ b/src/blenderbim/blenderbim/bim/module/geometry/operator.py @@ -269,8 +269,14 @@ class UpdateRepresentation(bpy.types.Operator, Operator): core.edit_object_placement(tool.Ifc, tool.Geometry, tool.Surveyor, obj=obj) if material and material.is_a() in ["IfcMaterialProfileSet", "IfcMaterialLayerSet"]: - # These objects are parametrically based on an axis and should not be modified as a mesh - return + if self.ifc_representation_class == "IfcTessellatedFaceSet": + # We are explicitly casting to a tessellation, so remove all parametric materials. + element_type = ifcopenshell.util.element.get_type(product) + ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=element_type) + ifcopenshell.api.run("material.unassign_material", tool.Ifc.get(), product=product) + else: + # These objects are parametrically based on an axis and should not be modified as a mesh + return old_representation = self.file.by_id(obj.data.BIMMeshProperties.ifc_definition_id) context_of_items = old_representation.ContextOfItems