Rythe-Engine
Rythe-Engine copied to clipboard
OBJ material importer fails to properly join paths
Describe the bug The OBJ loader fails to load textures that are stored in relative paths to the obj file. If such a path occurs, it simply adds the model's path to the path.
For example:
- Model path: "assets:\some_folder\model.obj"
- Texture described in mtl file: "..\texture_folder\texture.png"
- Resulting texture path: "assets:\some_folder..\texture_folder\texture.png"
Include a MRE Load any model where the mtl uses a relative texture path with ../
Expected behavior The relative filepath should be resolved appropriately by checking for .. before combining the paths
Desktop (please complete the following information):
- OS: Windows 10
looking at the source code for mesh_importers.cpp I suspect that the lines 411, 415, 419 and others alike should use strpath_manip::subdir
instead of +
@GlynLeine ?
this also warants the question if strpath_manip might need a public interface and should be moved out of the detail
namespace, seeing as it is quite usefull for most applications
this also warants the question if strpath_manip might need a public interface and should be moved out of the
detail
namespace, seeing as it is quite usefull for most applications
probably yeah, i can't do anything about it untill beginning september tho. until then I'll be without laptop and most times without internet as well.