IndexOutOfBoundsException when loading some .obj files

Hi All,

I noticed that when trying to load some .obj models, an IndexOutOfBoundsException gets thrown and the model fails to load.

Could it be related to a model’s polygon count? i.e. That JME only supports models below a certain poly threshold?

java.lang.IndexOutOfBoundsException: Index: 2899, Size: 2899

at java.util.ArrayList.RangeCheck(

at java.util.ArrayList.get(

at com.jme3.scene.plugins.OBJLoader.readFace(

at com.jme3.scene.plugins.OBJLoader.readLine(

at com.jme3.scene.plugins.OBJLoader.load(

at com.jme3.asset.DesktopAssetManager.loadAsset(

at com.jme3.asset.DesktopAssetManager.loadModel(

at com.jme3.asset.DesktopAssetManager.loadModel(

at ui.jmonkey.spatials.Vessel.constructHull(

at ui.jmonkey.spatials.Vessel.access$000(

at ui.jmonkey.spatials.Vessel$




at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(

at com.jme3.system.lwjgl.LwjglCanvas.runLoop(



More like non-triangle faces, strange materials and the likes in the model causing this.

OK, thanks. Is there any export mode in Blender that you would recommend?

ogre xml?

I mean why are you using obj are there any good reasons, because if not I would say ogrexml is far supirior in any way

If you can, please post the OBJ file that causes the exception.

Sure, thanks. Here you go:

@Empire Phoenix: Yup, OgreXML always works indeed. I was just wondering why some .obj files didn’t work :slight_smile: