diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index d4b864ec62..df6196b3d4 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -906,7 +906,7 @@ class LoadProject(bpy.types.Operator, IFCFileSelector): if not filepath: return tooltip filepath = Path(filepath) - tooltip += f".\n" + tooltip += ".\n" if not filepath.exists(): tooltip += "\nFile does not exist" return tooltip @@ -977,7 +977,7 @@ class LoadProject(bpy.types.Operator, IFCFileSelector): bpy.ops.bim.convert_to_blender() context.scene.BIMProperties.ifc_file = filepath - if not (ifc_file := tool.Ifc.get()): + if not tool.Ifc.get(): self.report( {"ERROR"}, f"Error loading IFC file from filepath '{filepath}'. See logs above in the system console for the details.", @@ -1593,6 +1593,7 @@ class ExportIFC(bpy.types.Operator): output_file = bpy.path.ensure_ext(self.filepath, ".ifcjson") else: output_file = bpy.path.ensure_ext(self.filepath, ".ifc") + output_file = Path(output_file).as_posix().replace("\\", "/") settings = export_ifc.IfcExportSettings.factory(context, output_file, logger) settings.json_version = self.json_version @@ -1612,7 +1613,7 @@ class ExportIFC(bpy.types.Operator): new.name = output_file if context.scene.BIMProjectProperties.use_relative_project_path and bpy.data.is_saved: output_file = os.path.relpath(output_file, bpy.path.abspath("//")) - if scene.BIMProperties.ifc_file != output_file and extension not in ["ifczip", "ifcjson"]: + if scene.BIMProperties.ifc_file != output_file and extension not in ("ifczip", "ifcjson"): scene.BIMProperties.ifc_file = output_file save_blend_file = bool(bpy.data.is_saved and bpy.data.is_dirty and bpy.data.filepath) if save_blend_file: diff --git a/src/bonsai/bonsai/bim/ui.py b/src/bonsai/bonsai/bim/ui.py index 8326ab1b66..a666d3fd94 100644 --- a/src/bonsai/bonsai/bim/ui.py +++ b/src/bonsai/bonsai/bim/ui.py @@ -66,7 +66,7 @@ class IFCFileSelector: if self.use_relative_path: filepath = filepath.relative_to(bpy.path.abspath("//")) - return filepath.as_posix() + return filepath.as_posix().replace("\\", "/") def draw(self, context: bpy.types.Context) -> None: assert isinstance(context.space_data, bpy.types.SpaceFileBrowser) diff --git a/src/bonsai/bonsai/tool/blender.py b/src/bonsai/bonsai/tool/blender.py index 5a73420e25..605bcbab90 100644 --- a/src/bonsai/bonsai/tool/blender.py +++ b/src/bonsai/bonsai/tool/blender.py @@ -869,7 +869,7 @@ class Blender(bonsai.core.tool.Blender): cls.open_file_or_folder(filepath.as_posix()) return {"PASS_THROUGH"} - # holding sHIFT - open file + # holding SHIFT - open file if not filepath.exists(): operator.report({"ERROR"}, f'Cannot open non-existing file: "{filepath.as_posix()}"') return {"CANCELLED"}