Use platform-specific path separator #14
Merged
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.
When importing a gltf, for textures the addon simply joins the path that exists in the material custom properties. This path uses Windows-style path separators (
\
), which on Linux and Mac OS causes the file load to fail because it produces a path that looks something like/home/user/meddle-export/cache/modded\abc\def\ghi\file.tex.png
. This basically results in a broken import where the user has to manually apply every texture to every relevant material and node.This patch uses
bpy.path.native_pathsep
to convert these paths to whatever is appropriate. gltf imports then just work fine and textures are loaded properly.(I'm super new to blender and python scripting so whatever I'm doing wrong or in a weird or inefficient way please point it out).