Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix problems with relative paths on Windows #40

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

w1th0utnam3
Copy link
Member

@w1th0utnam3 w1th0utnam3 commented Jan 17, 2025

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: use bpy.path.abspath
  • The same applies to fileseq.findSequenceOnDisk, however this also seems to break with paths containing ... Solution: convert to a fully absolute path with os.path.abspath
  • Extracting a sequence directory and pattern with os.path.dirname/basename does not work on Blender relative paths. Solution: do this before converting absolute to relative paths
  • At least on Windows, bpy.path.relpath and bpy.path.abspath do not work correctly with a Blender relative path as start argument. Solution: turn it into an absolute path with bpy.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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant