Nullpointer Exception JmeToMax in update of Basic Game?

I try to load a Max model via JmeToMax in the update cycle of a Basic game



   maxToJme.convert(is, byteArrayOutputStream);


both is and byteArrayOuputStream are != null

and get


java.lang.NullPointerException
        at com.jmex.model.converters.maxutils.MaterialBlock.initializeVariables(MaterialBlock.java:80)
        at com.jmex.model.converters.maxutils.MaterialBlock.<init>(MaterialBlock.java:75)
        at com.jmex.model.converters.maxutils.EditableObjectChunk.processChildChunk(EditableObjectChunk.java:94)
        at com.jmex.model.converters.maxutils.ChunkerClass.chunk(ChunkerClass.java:94)
        at com.jmex.model.converters.maxutils.EditableObjectChunk.<init>(EditableObjectChunk.java:80)
        at com.jmex.model.converters.maxutils.TDSFile.processChildChunk(TDSFile.java:102)
        at com.jmex.model.converters.maxutils.ChunkerClass.chunk(ChunkerClass.java:94)
        at com.jmex.model.converters.maxutils.TDSFile.chunk(TDSFile.java:70)
        at com.jmex.model.converters.maxutils.TDSFile.<init>(TDSFile.java:92)
        at com.jmex.model.converters.MaxToJme.convert(MaxToJme.java:75)



it looks like if


protected void initializeVariables(){
        myMatState=DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();
        myMatState.setEnabled(false);
        myWireState=DisplaySystem.getDisplaySystem().getRenderer().createWireframeState();
        myWireState.setEnabled(false);
        myTexState=DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
        myTexState.setEnabled(false);
    }



is null.
loading in initSystem or initGame works fine

Can someone point me in the right direction

You have any luck with this one?



I'm guessing that you're running jME 2, right?  You can reproduce this problem if you simple run the main() of the MaxToJme class in jME 2.  I'm having an identical problem with a command line model baker i have for my resources.  I haven't found a solution yet.

Check this out:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=9517.0

many thanks for info!



I have not been able to solve the problem until now :slight_smile:



Great work!!