Skip to content

Conversation

BlueSkia
Copy link
Contributor

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).

@PassiveModding
Copy link
Owner

looks good to me and verified still working on windows, honestly I expected path.join to have fixed that already but seems it was a misunderstanding on my end.
Thanks

@PassiveModding PassiveModding merged commit efbf46c into PassiveModding:main Apr 29, 2025
@BlueSkia BlueSkia deleted the fix-pathsep branch April 29, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants