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

OBJ material importer fails to properly join paths #355

Open
LeonBrands opened this issue Aug 9, 2021 · 3 comments
Open

OBJ material importer fails to properly join paths #355

LeonBrands opened this issue Aug 9, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@LeonBrands
Copy link
Collaborator

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
@LeonBrands LeonBrands added the bug Something isn't working label Aug 9, 2021
@Algo-ryth-mix
Copy link
Member

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 ?

@Algo-ryth-mix
Copy link
Member

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

@Algo-ryth-mix Algo-ryth-mix changed the title OBJ loader doesn't handle relative image paths (e.g. ../thing) OBJ material importer fails to properly join paths Aug 9, 2021
@GlynLeine
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants