-
-
Notifications
You must be signed in to change notification settings - Fork 624
Description
Hi @silverweed, Hi @syoyo !
I just updated tinyobj for my application, and there seems to be a problem:
On Windows, if the .mtl file is in the same directory and simply referenced as, say "myMTLFile.mtl" from within the OBJ, the current version fails to load it. There was a recent change via a PR: #176
I suppose this is what broke it for this particular case - for the example mentioned above I get a warning from tinyOBI saying "WARN: Material file [ \myMTLFile.mtl ] not found.". I am not sure what would be the correct way to fix this (without breaking what @silverweed fixed in #176, for example). For now I added a workaround changing the following (line 1747)
if (baseDir[baseDir.length() - 1] != dirsep)
baseDir += dirsep;
to
if (!baseDir.empty() && baseDir[baseDir.length() - 1] != dirsep)
baseDir += dirsep;
This worked for me, but, again, not sure if this is a good final fix.
Thanks & keep up the great work!