assign_class - replace object with empty if no representation was added

Same goal as ffffcc576e - prevent user confusion when they reload IFC file and see the representation is gone.
This commit is contained in:
Andrej730
2025-04-15 11:20:11 +05:00
parent b59e5b076d
commit cb7e04f61a
@@ -302,7 +302,11 @@ class AssignClass(bpy.types.Operator, tool.Ifc.Operator):
context=ifc_context,
ifc_representation_class=self.ifc_representation_class,
)
tool.Geometry.reload_representation(obj)
representation = tool.Geometry.get_active_representation(obj)
if representation:
tool.Geometry.reload_representation(obj)
elif obj.data is not None:
new_obj = tool.Geometry.recreate_object_with_data(obj, None)
# TODO: reload representation might lead to the object being replaced by object of the other type.
# We probably should track it somehow and keep the original selection.