From d1b6c1ffe4c98170e47ce51c1fe559a714c0bcff Mon Sep 17 00:00:00 2001 From: "Sigma Dimensions (Yass)" <79010126+myoualid@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:30:29 +0100 Subject: [PATCH] fix loading and unloading linked IFCs with a relative path --- src/blenderbim/blenderbim/bim/module/project/operator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/project/operator.py b/src/blenderbim/blenderbim/bim/module/project/operator.py index aa1c2309e9..1f924ab63e 100644 --- a/src/blenderbim/blenderbim/bim/module/project/operator.py +++ b/src/blenderbim/blenderbim/bim/module/project/operator.py @@ -850,7 +850,7 @@ class UnloadLink(bpy.types.Operator): for scene in bpy.data.scenes: if scene.library and scene.library.filepath == filepath: bpy.data.scenes.remove(scene) - link = context.scene.BIMProjectProperties.links.get(filepath) + link = context.scene.BIMProjectProperties.links.get(self.filepath) link.is_loaded = False return {"FINISHED"} @@ -866,7 +866,7 @@ class LoadLink(bpy.types.Operator): filepath = self.filepath if not os.path.isabs(filepath): filepath = os.path.abspath(os.path.join(bpy.path.abspath("//"), filepath)) - with bpy.data.libraries.load(self.filepath, link=True) as (data_from, data_to): + with bpy.data.libraries.load(filepath, link=True) as (data_from, data_to): data_to.scenes = data_from.scenes for scene in bpy.data.scenes: if not scene.library or scene.library.filepath != filepath: @@ -875,7 +875,7 @@ class LoadLink(bpy.types.Operator): if "IfcProject" not in child.name: continue bpy.data.scenes[0].collection.children.link(child) - link = context.scene.BIMProjectProperties.links.get(filepath) + link = context.scene.BIMProjectProperties.links.get(self.filepath) link.is_loaded = True return {"FINISHED"}