.obj load errors

I keep getting the same null pointer exception when trying to convert a .obj file.



java.lang.NullPointerException

at com.jmex.model.converters.ObjToJme$MaterialGrouping.<init>(ObjToJme.java:465)

at com.jmex.model.converters.ObjToJme.convert(ObjToJme.java:140)

at org.sharedmemory.client.ModelTest.<init>(ModelTest.java:82)

at org.sharedmemory.client.ModelTest.main(ModelTest.java:155)



At first, I thought it was a problem with my source (zbrush) but I have tried several models now that all load fine in several editors.



The actual code to do the convertion is as simple as it can be:



ObjToJme converter=new ObjToJme();

URL objFile = new URL("file:///Users/kapper/code/jmegame/data/sample.obj");

ByteArrayOutputStream out = new ByteArrayOutputStream();

converter.convert(objFile.openStream(), out);



Anybody have any ideas about how to solve this?

Which version of jME are you using?  In my source, that line would indicate the renderer was null.  This might mean you've set your display but have not created a window/canvas yet?

Thanks! Problem solved… I didn't realize the conversion util uses the render system, but I guess it makes sense to implement it by building a model from an obj file and then serializing it afterwards :slight_smile:



(oh, and I'm using the latest version from the google code repository)