Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix texture map name & path #48

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

Conversation

sneakyevil
Copy link

There is small issue when using blender export and map for texture is actual path rather than filename.
The map_ can have "name" as C:\\...\\Diffuse.png which result in name having that "name" and path gets strcat with base causing path been actually invalid. This pull request will fix it, but maybe some edit could be done if needed.

@zeux
Copy link
Contributor

zeux commented Oct 29, 2024

This would break paths like this: textures/file.png; feels like this needs explicit absolute path detection: either first character is one of the separators (handles both Unix and Windows absolute paths, Windows can have a path start with a \ if it's a UNC path), or first character is alphabetic, second character is : and third character is one of the separators (Windows drive paths).

@sneakyevil
Copy link
Author

sneakyevil commented Oct 29, 2024

I didn't think about those paths, but I can't think of proper way to even implement this besides explicitly checking if the file exist and then setting the base path? But this could give false positive if the file actually doesn't exist or if both paths are valid which in this case the path textures/file.png still could be valid if working directory has own files.

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