Fix #5543. Updating a representation reloads the representation.

This commit is contained in:
Dion Moult
2024-10-08 15:45:03 +11:00
parent 1b321f0747
commit 32899ebffb
3 changed files with 7 additions and 0 deletions
@@ -410,6 +410,7 @@ class UpdateRepresentation(bpy.types.Operator, tool.Ifc.Operator):
continue
self.update_obj_mesh_representation(context, obj)
tool.Ifc.finish_edit(obj)
tool.Geometry.reload_representation(objs)
return {"FINISHED"}
def update_obj_mesh_representation(self, context: bpy.types.Context, obj: bpy.types.Object) -> None:
@@ -68,6 +68,10 @@ def update_representation_obj(self, context):
if data and not data.users:
bpy.data.meshes.remove(data)
self.item_objs.clear()
if not self.representation_obj and self.mode != "OBJECT":
self.is_changing_mode = True
self.mode = "OBJECT"
self.is_changing_mode = False
def get_mode(self, context):
@@ -834,6 +834,8 @@ class EditOpenings(Operator, tool.Ifc.Operator):
self.get_all_building_objects_of_similar_openings(opening)
) # NB this has nothing to do with clone similar_opening
tool.Ifc.unlink(element=opening)
if bpy.context.scene.BIMGeometryProperties.representation_obj == opening_obj:
bpy.context.scene.BIMGeometryProperties.representation_obj = None
bpy.data.objects.remove(opening_obj)
tool.Model.reload_body_representation(building_objs)