unload decorations on unlinking ifc file

This commit is contained in:
Andrej730
2024-03-20 12:05:13 +05:00
parent a656d32e56
commit a511be18a8
@@ -907,8 +907,17 @@ class UnloadLink(bpy.types.Operator):
if scene.library and Path(scene.library.filepath) == filepath:
bpy.data.scenes.remove(scene)
link = context.scene.BIMProjectProperties.links.get(self.filepath)
link.is_loaded = False
links = context.scene.BIMProjectProperties.links
links.get(self.filepath).is_loaded = False
if not any([l.is_loaded for l in links]):
ProjectDecorator.uninstall()
# we make sure we don't draw queried object from the file that was just unlinked
elif queried_obj := context.scene.BIMProjectProperties.queried_obj:
queried_filepath = Path(queried_obj["ifc_filepath"])
if queried_filepath == filepath:
ProjectDecorator.uninstall()
return {"FINISHED"}