diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 7042789adb..d739c57c49 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -589,6 +589,7 @@ class UpdateRepresentation(bpy.types.Operator, tool.Ifc.Operator): tool.Material.ensure_material_unassigned([element_type]) ifcopenshell.api.material.unassign_material(self.file, products=[product]) tool.Material.ensure_material_unassigned([product]) + data = obj.data # Required after ensure_material_unassigned else: # These objects are parametrically based on an axis and should not be modified as a mesh if extrusion := tool.Model.get_extrusion(old_representation): diff --git a/src/bonsai/bonsai/tool/material.py b/src/bonsai/bonsai/tool/material.py index 0139a1b783..dde9cc53d8 100644 --- a/src/bonsai/bonsai/tool/material.py +++ b/src/bonsai/bonsai/tool/material.py @@ -329,7 +329,10 @@ class Material(bonsai.core.tool.Material): or some other may be applied now since it's no longer overridden, therefore we need to make sure blender materials reflect correct styles. - Designed to be called after material.unassign_material API call.""" + Designed to be called after material.unassign_material API call. + + Will reload representations, invalidating existing object data. + """ elements = elements.copy() # Avoid argument mutation. for element in elements[:]: if element.is_a("IfcElementType"):