Page MenuHome

Fix T102914: bpy.ops.wm.append no longer supports / in paths for WIN32
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Dec 6 2022, 1:06 AM.

Details

Summary

Support both forward and back slashes on WIN32.

Forward slashes for paths in WIN32 was removed in [0] (for BLI_path_join)
& [1] (for BLI_path_name_at_index), this is correct on UNIX as back
slashes can be used in paths but not on WIN32 which can use both.

Note that other path functions such as BLI_path_append &
BLI_path_slash_ensure should be updated too, but this is out of scope
for a bug-fix.

Documenting and ensuring Windows path handling functions all handle
forward slashes can be done separately.

[0]: 8f7ab1bf46d5e8610b167180b7631ff62e718a08
[1]: 511ae2226473df57e47b439392da387cd355abef


NOTE: This is a follow up patch that completes support for slashes in both directions on WIN32: P3364.

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Dec 6 2022, 1:06 AM
Campbell Barton (campbellbarton) created this revision.
Campbell Barton (campbellbarton) retitled this revision from Cleanup: remove unused argument to Fix T102914: bpy.ops.wm.append no longer supports / in paths for WIN32.Dec 6 2022, 1:06 AM
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)

Another commit was included accidentally.

Attempt to remove additional commit (take 2)

This fixes the issue reported in T102914: Regression: bpy.ops.wm.append can't run correct in blender 3.4 in that I can successfully append (on Windows) using either of

bpy.ops.wm.append(filepath='D:\\Test\\Simple.blend\\Object\\Cube', filename='Cube',directory='D:\\Test\\Simple.blend\\Object\\')
bpy.ops.wm.append(filepath='D:/Test/Simple.blend/Object/Cube', filename='Cube',directory='D:/Test/Simple.blend/Object/')
This revision is now accepted and ready to land.Dec 6 2022, 2:16 AM