mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user