BAT failes to find resources when parsing a blend file from a different platform #59124
Labels
No Label
legacy module
Platforms, Builds, Tests & Devices
legacy project
Blender Asset Tracer
legacy project
Platform: Windows
Priority::Normal
Status::Archived
Status::Confirmed
Status::Needs Triage
Status::Resolved
Type::Design
Type::Report
Type::To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-asset-tracer#59124
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I parsed the classroom.blend from the blender-benchmark. This file is created on windows and uses relative paths. These relative paths on linux are completed using pathlib. in linux a '' is a valid char to use in a filename.
For example:
Blender can't find the file as pathlib tries to find a file called
textures\radiator_AO.png
in folder/home/jeroen/blender-benchmark-1.0b2-linux-glibc219-x86_64/scenes/classroom/assets/radiator/
.According to blender BLI_Path we should convert the OS platform we are running on as slash and backslash are both invalid to be used in file and foldernames.
My proposal is to adapt the
BlendPath.to_path
method to convert the Windows slashes automatically to posix slashes.Added subscriber: @Jeroen-Bakker
Added subscriber: @dr.sybren
Added subscriber: @jasperge-2
Sounds good to me!
I've made a new branch windows-support to track Windows-specific fixes. They should only be merged to the master branch when they have been tested on (and proven compatible with) Linux.
@Jeroen-Bakker commented in IRC:
The separation between
BlendPath
andpathlib.Path
is a very conscious one:BlendPath
represents paths as stored in a blendfile. It consists of bytes, possibly with unknown character encoding and path separators. Only a limited set of path manipulation is possible, and it cannot be used to perform any actual filesystem operations.pathlib.Path
represents an interpreted path that has a clear definition and manipulation operations, and can be used to perform filesystem operations.I really want to keep this separation.
For better Windows compatibility, it's probably necessary to replace our use of
pathlib.Path
withpathlib.PurePosixPath
so that we always have forward slashes. There are some strange cases, though, as on Windows a path that's supposed to point to a file can all of a sudden get a trailing slash:This doesn't happen with
PurePosixPath
, which is why I want to use it as much as possible in our code. We can do this until real filesystem operations are necessary, such as callingPath.absolute()
.Changed status from 'Open' to: 'Resolved'
In current master (released as 0.8) all unit tests work on Windows as well. The
windows-support
branch has been deleted.If there are more Windows-incompatibilities, let me know!