From 181b0cefc3713cb594e292696e62ab923fe48b18 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 24 Oct 2024 14:13:31 +0500 Subject: [PATCH] Fix linking ifc from shared folder on Windows #5386 The problem was that shared folders names are starting with `\\`, e.g. `\\SERVERNAME\shared_folder`. When we pass path strings we usually sanitize them and save them as posix, so it's saved as `//SERVERNAME/shared_folder` and Blender has a convention that paths starting with `//` it interprets as filepaths relative to the current .blend file, therefore it was giving some weird error that `C:\Users\xxxx\SERVERNAME\shared_folder\test.blend` is missing instead of `\\SERVERNAME\shared_folder`. So need to be careful passing strings to Blender operators and use str instead of as_posix for those operators, so \\` wouldn't be misinterpreted. --- src/bonsai/bonsai/bim/module/project/operator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/project/operator.py b/src/bonsai/bonsai/bim/module/project/operator.py index 2ec00b4970..92eecd61d5 100644 --- a/src/bonsai/bonsai/bim/module/project/operator.py +++ b/src/bonsai/bonsai/bim/module/project/operator.py @@ -1142,7 +1142,8 @@ def run(): pprops.false_origin = "{pprops.false_origin}" pprops.project_north = "{pprops.project_north}" bpy.ops.bim.load_linked_project(filepath="{self.filepath}") - bpy.ops.wm.save_as_mainfile(filepath="{blend_filepath.as_posix()}") + # Use str instead of as_posix to avoid issues with Windows shared paths. + bpy.ops.wm.save_as_mainfile(filepath=r"{str(blend_filepath)}") try: run()