We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
Impossible to load a .mtl file. I get the following error: "/Applications/myObject.mtl does not exist or could not be read"
In the .obj file I have this line: "mtllib myObject.mtl"
Both .obj and .mtl are in the same data folder.
Everything works fine if I run the code in a dummy Processing project with the default IDE. But once in Eclipse I encounter the problem. I don't get why the string /Applications get append to the path. If in the .obj I use the absolute path, it "solves" the problem but I don't like this way since it will only work with my computer.
Does anyone has any idea?
Thanks,
Answers
I assume that in the Processing sketch you have created a folder called data and have put the file in there.
Depending on how you set up the Eclipse project the source files (.java) files are mixed with the compiled files (.class) or thay are in separate folders, src and bin. Try creating a folder called data inside the bin folder or alongside the .class files and put the files in there. Might work :)
Alternatively have a boolean constant called ECLIPSE which is set according to the IDE. Then use this to decide on the file location when loading.