3DS modeling issue

Hi everyone,



I'm new to the modeling side of JME so i apologise in advance if this is a stupid question, but Ive looked everywhere on these forums and cant find a answer to my problem. I am simply trying to load a 3DS model into my program. my code is:



      Node objMax = new Node();



      URL modelURL=blueMesh.class.getClassLoader().getResource("bike.3ds");

    //  URL textureURL=blueMesh.class.getClassLoader().getResource("");

      BinaryImporter importer = BinaryImporter.getInstance();

      FormatConverter converter=new MaxToJme();

      ByteArrayOutputStream BO=new ByteArrayOutputStream();

      try {

          converter.convert(modelURL.openStream(), BO);

          objMax=(Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

          //objMax[0].setCullMode( SceneElement.CULL_NEVER );

          objMax.setModelBound(new BoundingBox());

          objMax.updateModelBound();



      } catch (IOException e) {

          e.printStackTrace();

          System.exit(0);

      }



the error occurs on this line:

-            converter.convert(modelURL.openStream(), BO);



and i get this read out:

******************************************************************************************************

21/10/2007 14:36:24 com.jme.scene.Node <init>

INFO: Node created.

21/10/2007 14:36:25 com.jme.system.lwjgl.LWJGLDisplaySystem <init>

INFO: LWJGL Display System created.

Exception in thread "main" java.lang.NullPointerException

at com.jmex.model.converters.maxutils.MaterialBlock.initializeVariables(Unknown Source)

at com.jmex.model.converters.maxutils.MaterialBlock.<init>(Unknown Source)

at com.jmex.model.converters.maxutils.EditableObjectChunk.processChildChunk(Unknown Source)

at com.jmex.model.converters.maxutils.ChunkerClass.chunk(Unknown Source)

at com.jmex.model.converters.maxutils.EditableObjectChunk.<init>(Unknown Source)

at com.jmex.model.converters.maxutils.TDSFile.processChildChunk(Unknown Source)

at com.jmex.model.converters.maxutils.ChunkerClass.chunk(Unknown Source)

at com.jmex.model.converters.maxutils.TDSFile.chunk(Unknown Source)

at com.jmex.model.converters.maxutils.TDSFile.<init>(Unknown Source)

at com.jmex.model.converters.MaxToJme.convert(Unknown Source)

at Sources.blueMesh.CreateMAX(blueMesh.java:64)

at BlueEngine.Blue.main(Blue.java:47)

***********************************************************************************************************************



any more information let me know, if you could please help it would be greatly appriciated.



thank you

Looking at the log it seems like renderer was not created when the model is loaded. You need to wait till the display fully initializes and then you can load your model.

thanks for the reply,



that work! :slight_smile: