Importing models from Makehuman through Blender

Hello,
I am a bit new to jMonkeyEngine and I am having some problems importing models to it.
When I try to import my models from MakeHuman (exported as .mhx) through Blender (import the .mhx, then export it as OGRE scene) but when I try to import it to jMonkey
[java]
Spatial gameLevelT = assetManager.loadModel(“Scenes/demo0/demo.scene”);
[/java],

it throws this Exception:

java.lang.IndexOutOfBoundsException: Index: 4, Size: 4 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at com.jme3.scene.plugins.ogre.MeshLoader.startSubmeshName(MeshLoader.java:603) at com.jme3.scene.plugins.ogre.MeshLoader.startElement(MeshLoader.java:656) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:506) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:888) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283) at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:369) at com.jme3.scene.plugins.ogre.SceneLoader.parseEntity(SceneLoader.java:302) at com.jme3.scene.plugins.ogre.SceneLoader.startElement(SceneLoader.java:388) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:506) at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:353) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2717) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568) at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:530) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283) at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:369) at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:373) at mygame.Main.simpleInitApp(Main.java:49) at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225) 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:724)

I tried it with several different settings when exporting the .mhx from MakeHuman but the exception persists, and yes it is still there even when the model has been triangulated.

I have also tried removing armature or other extra stuff, just to see if there is a way to import the mesh alone, but I had no luck with that either

It worked only when I exported->imported it as .obj, but then I had problems with the textures around the eyes (there was also a similar problem to that when I tried to import it to Unity3D (from .blend) some weeks ago and in that case some different setting regarding the texture in the specific areas (which the program recognized as separated ones) solved it.

Ok, I found the problem, it was in the materials, there was 4 extra materials (Red, Green, Blue and Invisio) that is seamed to be useless, I removed them and the model seams to be loaded fine with 1 problem, there is no texture around the eyes, just like what was happening with the .obj as I said in the earlier post.

I tried to export OBJ directly from MakeHuman with eyebrows and eyelashes unchecked and it if fine accept that there is no eyes and no eyelashes (they are black), other than that (eyebrows) it looks fine.

PS: I checked the mouth, it has a material and it is ok

Maybe I’ve misunderstood you, but do you know jME3 supports direct importing of the .blend format?

Additional reading:
http://hub.jmonkeyengine.org/forum/topic/using-makehuman-models/#post-211729
http://hub.jmonkeyengine.org/forum/topic/makehuman-with-ogre3d-export/

No, I did not know that, because of the tutorial (“introducing assets”) I thought that exporting to Ogre3D was essential.

THANK YOU very much, I will try it with .blend files asap during the next days and I’ll post my results (good, bad or neutral) here :smiley:

@orestes.k.poulakis said: No, I did not know that, because of the tutorial ("introducing assets") I thought that exporting to Ogre3D was essential.(...)
I assume you're talking about the "Hello Asset" tutorial? @kaelthas @zathras --poke

Yes, that’s the one, I am sorry… :wink: