-
Notifications
You must be signed in to change notification settings - Fork 60
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
parsing doesn't know the file name, but mtllib
is relative to that file
#38
Comments
It's just an unimplemented feature. We need to implement a feature to supply search path to PR is welcome! |
@martinhath If you would like a solution to link object's materials to mtllib materials, I created a solution to instead to get the object name, get its material name, and use that material name to then look for its corresponding texture. Let me know if you would like me to upload it here :) |
@syoyo Glad to hear it! @iyenal I have a folder full of I ended up hacking something together in which the user can supply the filename of the I appreciate the decoupling of file reading and If anyone finds this useful, these are my changes:
|
We can implement both. One is supply both filename(for the use of .mtl search) and its content, something like what libjsonnet's evaluateSnippet does: And another is supply callback functions for resource access(.obj, .mtl, etc) |
I have an
obj
andmtl
file exported from blender in a directory, and I'd like to read them both.I'm using
tinyobj_parse_obj
for this, which takes the.obj
file as achar *
as input. However, one of the commands in the file ismtllib <filename>.mtl
, which it tries to read, and fails, since the files aren't in the same directory as the executable. Sincetinyobj_parse_obj
doesn't know anything about the location of theobj
file it would be unable to locate the.mtl
file, since I assumemtllib
is supposed to give a relative path.Is this a bug, or is there some way of handing this?
The text was updated successfully, but these errors were encountered: