OgreXML, no ".xml" files

Hey,



When I try to export 3DS Max models via OgreXML Exporter, I have no “.xml” file as output… All I have are some “.material”, “.scene” and “.mesh” files.



Is this the right way ? Cause I saw that the assetManager was loading “.xml” files in tutorials.

If it is, how do I use those files to import my models into my app via Eclipse ?



Thx !

You would have to convert them to XML using the command line converter… Or you simply use the SDK which contains the converter and automatically does that for your while importing the .mesh file.

Btw, I strongly suggest using jMP for development, there is really no difference between Eclipse and NetBeans/jMP, you can even set your keyboard configuration to the same as eclipse. I am using Eclipse for JavaCard and GWT web programming and really there is no reason whatsoever to choose one IDE over the other especially when you get a version especially designed for the task at hand.

I only use Eclipse 'cause of the Android SDK. I wish I could use jMP, all would be way easier, but it’s just too complicated to develop for Android under jMP for now.



Regarding the converter, how do I do this ? For instance, I have 3 “.mesh” files, 1 “…material”, 1 “…scene” (the double dot is making me feel weird, I don’t know if it’s normal), and 3 “.tga” which are my textures. How do I do to import all this stuff in my app and display it ? I’m really confused about this all.

Developing Android is not complicated, just install the NBAndroid plugin, create an android project with a harness and reference your main projects output jars. Importing the model works by double-clicking the mesh file in jMP or using the Ogre command line tools as I said.

Ok so I have double-cliked my files into jMP and I now have a “.xml” file + 2 “.j3o” and “j3odata” files. I try to load the “.xml” using:



[java]model = assetManager.loadModel("Models/MyModel.mesh.xml");[/java]



And then I run it all (on Android). But all I have is a black screen (not crashed though I think)and the following log error:


06-09 16:44:09.987: WARN/AndroidLocator(31578): Failed to locate {0}
06-09 16:44:09.997: WARN/MeshLoader(31578): Cannot locate {0}{1}.material for model {2}{3}.{4}
06-09 16:44:10.007: WARN/dalvikvm(31578): threadid=8: thread exiting with uncaught exception (group=0x40020ce0)
06-09 16:44:10.037: ERROR/Application(31578): Uncaught exception thrown in Thread[GLThread 9,5,main]
06-09 16:44:10.037: ERROR/Application(31578): com.jme3.asset.AssetLoadException: An exception has occured while loading asset: Models2/Finish.mesh.xml
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:242)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:373)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:383)
06-09 16:44:10.037: ERROR/Application(31578): at com.lesmobilizers.helloandroidharness.apps.ModelImportTest.simpleInitApp(ModelImportTest.java:22)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:223)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.system.android.OGLESContext.initInThread(OGLESContext.java:176)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.system.android.OGLESContext.onSurfaceCreated(OGLESContext.java:288)
06-09 16:44:10.037: ERROR/Application(31578): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1317)
06-09 16:44:10.037: ERROR/Application(31578): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
06-09 16:44:10.037: ERROR/Application(31578): Caused by: java.io.IOException: Error while parsing Ogre3D mesh.xml
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:820)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:240)
06-09 16:44:10.037: ERROR/Application(31578): ... 8 more
06-09 16:44:10.037: ERROR/Application(31578): Caused by: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:TEXT ��[MeshSerialize...@5:51 in java.io.InputStreamReader@46c87668)
06-09 16:44:10.037: ERROR/Application(31578): at org.xmlpull.v1.sax2.Driver.parse(Driver.java:331)
06-09 16:44:10.037: ERROR/Application(31578): at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:815)
06-09 16:44:10.037: ERROR/Application(31578): ... 9 more


Why :cry: ?

Err, just load the j3o?

It kinda works loading the “.j3o” but there is no textures and I have to load all the items of the scene. I thought there would be a way to load the whole scene items and textures in a single code line…

Yeah, the textures have to be in the same path they were when the j3o was created. So when you had it under /Models in the jMP project then the textures need to be there as well. Please, please read, research and try more before you post every single step you do in the forum. I know its tempting because theres always somebody there but from what I see all you achieved has basically been done by the people here kind enough to help you. A bit more effort before posting would be adequate.

But my textures are in the same folder than my models… and honestly, I try my best to do the most I can by my own, it’s time wasting for me as well each time I post and wait for an answer you know, but seriously, it’s all going wrong and I just don’t understand why and it’s making me late regarding my schedule. So I know that it can be really annoying for you to answer the numerous posts of the forum and I’m really thankful you do it but I have to insert models that I haven’t created (cause they are made by a graphist and he made those models for me without knowing anything of jME and to say it right, jME is none of his business actually). So I am kind of a link between the graphic part and the coding one and I don’t even know if both are compatibles (that’s what I’m trying to figure out actually).



I’ve read the documentation about import of models and I found this:



https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:3d_models



this is ok for basic approaches but it doesn’t help me much with my problem.

Any game-ready model can be imported, there is no special “jme3 requirements”. And I said in the same path, not folder. If the model has been converted in the path “/Models/Ogre.mesh.xml” and the texture was in “/Models/texture.jpg” then it has to be in the folder “/Models/texture.jpg” when you load it too, not in e.g. “/AndroidModels/texture.jpg”.

Oh I see… then I’m back to square one (sigh).