Import animated milkshape3d model in jme

Hi there,

how can I import milkshape models in jme know? i tryed the ogre export in milkshape. But after i converted the .mesh file with the ogrexmlconverter to xml, i couldnt load the model in jme.

What is the error?

well first of all, my xml file name is imp1.mesh.xml. in that exists <submesh material="Mat1Tex2… these Mat1Tex2 is defined in imp1.material, which produce the warning:

19.12.2010 02:51:13 com.jme3.scene.plugins.ogre.MeshLoader applyMaterial

WARNUNG: Material Mat1Tex2 not found. Applying default material



Also the skeleton cant be loaded. Its defined in imp1.skeleton.xml:

[java]19.12.2010 02:51:14 com.jme3.app.Application handleError

SCHWERWIEGEND: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.NullPointerException

at com.jme3.scene.plugins.ogre.SkeletonLoader.fullReset(SkeletonLoader.java:235)

at com.jme3.scene.plugins.ogre.SkeletonLoader.load(SkeletonLoader.java:266)

at com.jme3.scene.plugins.ogre.SkeletonLoader.load(SkeletonLoader.java:274)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:224)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:254)

at com.jme3.scene.plugins.ogre.MeshLoader.startSkeleton(MeshLoader.java:513)

at com.jme3.scene.plugins.ogre.MeshLoader.startElement(MeshLoader.java:580)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:773)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:224)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:346)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:356)

at animatedModels.Creatures.<init>(Creatures.java:11)

at terrain.TerrainMap.<init>(TerrainMap.java:32)

at main.MainApp.simpleInitApp(MainApp.java:266)

at main.MainApp.initialize(MainApp.java:216)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:134)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:183)

at java.lang.Thread.run(Thread.java:619)[/java]

Creatures is the class, where I try to load the model with:

assetManager.loadModel(“models/animated/creatures/imp1.mesh.xml”);



btw, I am sry to not post the errors on my first post. but i was konfused about the not workin import and forgot to post it :frowning:

Its seems like I found the problem. I didnt converted the skeleton file with the xmlconverter. after that, the model can be loaded, but without texture (well, i forgot to export that too).



But when I export the model with texture i have a problem while trying to load it:

[java]

19.12.2010 15:58:24 com.jme3.app.Application handleError

SCHWERWIEGEND: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.util.NoSuchElementException

at java.util.Scanner.throwFor(Scanner.java:838)

at java.util.Scanner.next(Scanner.java:1347)

at com.jme3.scene.plugins.ogre.MaterialLoader.readTextureImage(MaterialLoader.java:118)

at com.jme3.scene.plugins.ogre.MaterialLoader.readTextureUnitStatement(MaterialLoader.java:166)

at com.jme3.scene.plugins.ogre.MaterialLoader.readTextureUnit(MaterialLoader.java:202)

at com.jme3.scene.plugins.ogre.MaterialLoader.readPassStatement(MaterialLoader.java:240)

at com.jme3.scene.plugins.ogre.MaterialLoader.readPass(MaterialLoader.java:272)

at com.jme3.scene.plugins.ogre.MaterialLoader.readTechnique(MaterialLoader.java:289)

at com.jme3.scene.plugins.ogre.MaterialLoader.readMaterialStatement(MaterialLoader.java:296)

at com.jme3.scene.plugins.ogre.MaterialLoader.readMaterial(MaterialLoader.java:318)

at com.jme3.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:384)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:224)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:254)

at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:766)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:224)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:346)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:356)

at animatedModels.Creatures.<init>(Creatures.java:11)

at terrain.TerrainMap.<init>(TerrainMap.java:32)

at main.MainApp.simpleInitApp(MainApp.java:266)

at main.MainApp.initialize(MainApp.java:216)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:134)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:183)

at java.lang.Thread.run(Thread.java:619)

[/java]



My material file contains:

[java]

material Mat1Tex2

{

technique

{

pass

{

ambient 0 0 0 1

diffuse 0.784314 0.784314 0.784314 1

specular 0 0 0 1 6.4



texture_unit

{

texture .imp.gif -1

}

}



}



}

[/java]



the gif file imp.gif exists in same directory as the model.

Okay both of those should be fixed now.

thx, yes it works now :slight_smile: