ArrayIndexOutOfBounceException while loading mesh.xml file

Hey guys,

As you can see in the Title an error occures when I try to load my mesh.xml file. I am using the same Code(https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_animation.html) as its used in the tutorial except the file path(changed to “Walking/Walking.mesh.xml”) in line 35.

But I also get the following error:
Schwerwiegend: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.ArrayIndexOutOfBoundsException: 4
at com.jme3.scene.plugins.ogre.MaterialLoader.readTextureUnit(MaterialLoader.java:196)
at com.jme3.scene.plugins.ogre.MaterialLoader.readPassStatement(MaterialLoader.java:246)
at com.jme3.scene.plugins.ogre.MaterialLoader.readPass(MaterialLoader.java:282)
at com.jme3.scene.plugins.ogre.MaterialLoader.readTechnique(MaterialLoader.java:298)
at com.jme3.scene.plugins.ogre.MaterialLoader.readMaterialStatement(MaterialLoader.java:304)
at com.jme3.scene.plugins.ogre.MaterialLoader.readMaterial(MaterialLoader.java:315)
at com.jme3.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:451)
at com.jme3.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:464)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:864)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:374)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:378)
at mygame.HelloAnimation.simpleInitApp(HelloAnimation.java:35)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)

The error only occures when I load the material File (Walking.material). It is in the same folder btw. I tried to load only the mesh.xml file and it worked but because of the missing material it was all red and I really dont know what to do…

I couldn’t spot that „Walking.material“ in the example. I guess you do it wrong, but hard to judge if we can not see the code which throws this exception…
Or I missed it?!

EDIT: Ok I saw it, so you load another model with a material or the like. Still don’t get it, better post your broken code here. And please please please use code blocks there is a sticky post on top which explains it => How to type code blocks

I am using the same Code as its used in the HelloAnimation Tutorial from jme3 as I wrote in my question

https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_animation.html

I simply changed the Path and yes the files I try to load are my own files. They are Created with FuseCC and imported to Blender where I exported them with the OgreExporter to a mesh and scene

Then something is wrong with that file.

Can I load .mtl files? I get the Problem that the engines thinks that the type of the file is “” instead of “.mtl”

https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_material.html

https://jmonkeyengine.github.io/wiki/jme3/intermediate/how_to_use_materials.html

https://jmonkeyengine.github.io/wiki/jme3/intermediate/best_practices.html#multi-media-asset-pipeline

https://jmonkeyengine.github.io/wiki/jme3.html#materials-light-shadow

So I imported my animated Model in Blender and exported as mesh and scene but I get a Diffuse/Gloss/Normal/Specular/Opacity picture for every part of it. So I have a Body/Top etc part. I tried to combine them to one object but in the end I have one mesh.xml file but different images for different parts. So I would have more than one diffuse texture etc…

You can select the checkbox in ogre export to combine materials into one. You will still have a separate mesh for each texture that you can use to assign different materials to. If you don’t want the separate meshes, bake your textures and use that image in a new material/texture that you assign to the model and you will only have the one mesh.

Yes I have one single mesh but still seperated Textures…

Ok, and?