fast_obj icon indicating copy to clipboard operation
fast_obj copied to clipboard

Fix texture map name & path

Open sneakyevil opened this issue 1 year ago • 2 comments

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.

sneakyevil avatar Sep 29 '24 14:09 sneakyevil

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

zeux avatar Oct 29 '24 00:10 zeux

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.

sneakyevil avatar Oct 29 '24 10:10 sneakyevil