From d57e152c7def74495a84fdfe0b0c96706da5a220 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 3 Jul 2023 17:09:01 +0500 Subject: [PATCH] Storing external styles paths as posix for cross platform compatibility Also it was wrongly referring to .blend file instead of .ifc to generate relative paths. --- src/blenderbim/blenderbim/bim/module/style/operator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/style/operator.py b/src/blenderbim/blenderbim/bim/module/style/operator.py index f3ee2ace67..3fbfde90c1 100644 --- a/src/blenderbim/blenderbim/bim/module/style/operator.py +++ b/src/blenderbim/blenderbim/bim/module/style/operator.py @@ -274,9 +274,10 @@ class BrowseExternalStyle(bpy.types.Operator): external_style = StyleAttributesData.data["style_elements"].get("IfcExternallyDefinedSurfaceStyle", None) if self.use_relative_path: - filepath = os.path.relpath(self.filepath, bpy.path.abspath("//")) + filepath = os.path.relpath(self.filepath, tool.Ifc.get_path()) else: filepath = self.filepath + filepath = Path(filepath).as_posix() attributes = { "Location": filepath,