Hi everyone, I have made an object with blender and i have exported it to .obj format. It uses a texture named texture0.jpg, and i load the model by using this class:
public final class Model {
public static Node load(String fileName) {
Node loadedModel = null;
URL model = Model.class.getClassLoader().getResource(fileName);
// Set up the converter and convert it to jbin format
FormatConverter converter = new ObjToJme();
converter.setProperty("mtllib", model);
converter.setProperty("texdir", model);
ByteArrayOutputStream BO = new ByteArrayOutputStream();
try {
converter.convert(model.openStream(), BO);
loadedModel = (Node) BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
} catch (IOException e) {
e.printStackTrace();
System.exit(0);
}
return loadedModel;
}
}
Well, in the route i pass to the class there are, 3 files, one .obj, one .mtl and the .jpg, but when i compile the project i obtain this warning:
21-ago-2010 15:55:37 com.jme.util.resource.ResourceLocatorTool locateResource
ADVERTENCIA: Unable to locate: /home/antu/workspace/Compas/bin/res/cajon/texture0.jpg
But if i go to that folder, the file it is really there. What could be the problem?