Fix problems with relative paths on Windows #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Windows, sequence loading with relative paths were broken (not sure when it worked for the last time). More specifically:
fileseq.findSequencesOnDisk
cannot deal with Blender relative paths (starting with//
) and needs a kind-of absolute path. Solution: usebpy.path.abspath
fileseq.findSequenceOnDisk
, however this also seems to break with paths containing..
. Solution: convert to a fully absolute path withos.path.abspath
os.path.dirname
/basename
does not work on Blender relative paths. Solution: do this before converting absolute to relative pathsbpy.path.relpath
andbpy.path.abspath
do not work correctly with a Blender relative path asstart
argument. Solution: turn it into an absolute path withbpy.path.abspath
I tested these changes on MacOS and they seem to work as intended.
Also this PR changes the recursive load to include the selected folder itself which is more in line with the common understanding of recursive commands. Alternatively, we could change the name to something like "load from subfolders recursively" or something like this.