jME Model support

Hey.



So jME3 claims to support lots of different types of models and I quote:



"Model Loading

COLLADA, 3DS, Obj, MD2, MD3, Milkshape, X3D, ASE support. Supports skin, bones and weighted skeletal animation."



However when i go:



 Spatial scene = assetManager.loadModel("resources/models/tube.ac");
or
 Spatial scene = assetManager.loadModel("resources/models/tube.3ds");



I get the error in my console:

WARNING DesktopAssetManager 19:48:17 No loader registered for type ac.
or
WARNING DesktopAssetManager 19:48:17 No loader registered for type 3ds.

I am using jME3.

Please tell me how I can load these supposedly - "supported" models. :D

It's actually jME2 that claims support for those models ;)  jME3 is OGRE-centric at this point in time…

The Ogre-centrism is bothering me a bit - no one's started an OgreXML export script for Blender 2.5 yet, and Blender 2.49b is usable but kinda icky.  :stuck_out_tongue:

so how the heck do i export in this ogre format…



so jme3 is actually downhill than that compared with jme2…nice work guys.


Fuzzo said:

The Ogre-centrism is bothering me a bit - no one's started an OgreXML export script for Blender 2.5 yet, and Blender 2.49b is usable but kinda icky.  :P


As a Collada user it hurts me too at times, but the rationale was to be sure that we have at least one extremely solid pipeline for reliably getting animations into the engine.  This was a point of contention in jME2 where the nice number of importers had relatively limited levels of functionality.

With regards to the 2.5 Blender exporter, my guess is that they're waiting for 2.6 to write a new one, as 2.5 is earmarked as a transitional version.. it isn't even functional to the level of the 2.4x line as of yet.  I share your pain though, Blender as a piece of UI design is something that I'm unable to wrap my head around.

renegadeandy said:

so how the heck do i export in this ogre format.....


http://www.ogre3d.org/download/tools

There's also an interesting looking sketchup exporter I've come across, it's not on the official OGRE page, but it looks to be up-to-date and notes not only features, but known bugs. http://www.di.unito.it/~nunnarif/sketchup_ogre_export/


renegadeandy said:

so jme3 is actually downhill than that compared with jme2...nice work guys.


Open source = community effort.  If you look at the commit logs from the jME1/2 importers, it was by no means a sole person.  As I mentioned earlier, there was a serious effort to solidify the art pipeline in this version and OGRE came into focus rather clearly.  There is, however, an effort to add Collada support.  No reason that other formats of interest couldn't be worked on.

Actually I'm qute happy with only ogrexml being supported, after I found a good exporter,

as the pipeline is now kinde clear, and due to the xml based format, I can include my own tools to optimize stuff or modify it the way I want.

Right well i installed said exporter - exported and when i attempt to load it into my game, the game draws a red cube?



so something has messed up.



Can somebody please export this .blender file for me and attach it!?



http://www.sendspace.com/file/bq053n



You found a good exporter - send it my blooming way!

well I don't use blender, actually for converting I often use DeleD

sbook i am actually quite taken aback by how good SketchUp is.



After having a play I have chosen version 7.1



I downloaded the tool you suggested from : http://www.di.unito.it/~nunnarif/sketchup_ogre_export/



I then drew my shape - and exported.



I try to load it into jme and it says :




1278376455_1_<Beige>2: emissive
1278376455_2_<DimGray>: emissive
1278376455_3_<LightGray>: emissive
1278376455_4_<Charcoal>: emissive
1278376455_5_jean_blue: emissive
1278376455_6_Color_000: emissive
1278376455_7_Material1: emissive
1278376455_8_<Burnt_Umber>1: emissive
1278376455_SketchupDefault: emissive
WARNING DesktopAssetManager 01:34:53 Failed to load resource: resources/models/halfpipe2.mesh.xml
java.io.IOException: Error while parsing Ogre3D mesh.xml
   at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:732)
   at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:146)
   at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:266)
   at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:276)
   at org.snow.main.Main.setupHill(Main.java:220)
   at org.snow.main.Main.simpleInitApp(Main.java:117)
   at com.jme3.app.SimpleBulletApplication.initialize(SimpleBulletApplication.java:253)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)
   at java.lang.Thread.run(Unknown Source)
Caused by: org.xml.sax.SAXParseException: The value of attribute "material" associated with an element type "null" must not contain the '<' character.
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
   at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:727)
   ... 9 more
WARNING DesktopAssetManager 01:34:53 Error occured while loading resource resources/models/halfpipe2.mesh.xml using MeshLoader
SEVERE Application 01:34:53 Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
   at com.jme3.asset.ModelKey.createClonedInstance(ModelKey.java:18)
   at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:170)
   at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:266)
   at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:276)
   at org.snow.main.Main.setupHill(Main.java:220)
   at org.snow.main.Main.simpleInitApp(Main.java:117)
   at com.jme3.app.SimpleBulletApplication.initialize(SimpleBulletApplication.java:253)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:102)
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:147)
   at java.lang.Thread.run(Unknown Source)



Just as a reference this is my sketchup file! http://www.sendspace.com/file/4pzruw

Cheers

Check out your mesh.xml and .material files…



Towards the top of the file (like the 2nd or 3rd line for the mesh.xml), you should see this line:


<submesh material = "1278377408_SketchupDefault" usesharedvertices="false" use32bitindexes="false">



Check that whatever value is set for the "1278377408_SketchupDefault" is the same as that named in the .material file..  It looks to me like the importer is unable to find the material.

In XML, the "<" character is not permitted inside an attribute value unless properly escaped.

Make sure your materials do not have those characters.



http://www.eggheadcafe.com/software/aspnet/32538394/attribute-value-illegal-c.aspx

renegadeandy said:

Right well i installed said exporter - exported and when i attempt to load it into my game, the game draws a red cube?

so something has messed up.

Can somebody please export this .blender file for me and attach it!?

http://www.sendspace.com/file/bq053n

You found a good exporter - send it my blooming way!

If you remove the huge tube you'll see that the scene has a cube. The cube does not have a material, so its colored red indicating that no material was found for it since thats an error.
The huge tube is a NURBS curve, you cannot export curves from modelling tools, you need to convert them into a mesh.
With the tube selected, press "Alt C" and then select Mesh,
Or in the menu Object -> Convert Object Type -> Mesh.
Also, don't forget to make a material for the tube.

About blender 2.5 export to Ogre.



You can model,texture, rig your model with blender 2.5 then open it with blender 2.49 and export it to ogre with no data loss (that's what i do).

This works as long as you don't animate your model in blender 2.5, because opening it back in blender 2.49 will completely screw up animations.



So model in 2.5, animate in 2.49 (the action editor is pretty much the same).



One rule of thumb before exporting is to make sure all modifiers are applied to the model. (except armature modifier of course)



I'm a bit bothered too about blender 2.5 ogre exporter because it seems to be supported by one guy alone, who seems very busy at the time, and Blender's Python API has changed a lot in 2.5, making the translation tricky.

But ogre is a strong basis, and many projects use it, so eventually an exporter will be developed one way or another.



By the way…a COLLADA support can't hurt.  :stuck_out_tongue:

renegadeandy said:

so jme3 is actually downhill than that compared with jme2...nice work guys.


I strongly suggest you to be friendly. These guys are making a good effort to establish an art pipeline that will work. Seeing as jme3 is not even in beta, you cannot expect everything to work. Plus you pissing people off with that kind of comment won't make things better.

Sweet - removed the < from the material names and it works.



IS that a bug to be recognised with the sketchup exporter developers?



Does anybody have a community they can report this to?



apologies for coming across as rude - I am incredibly impressed with jME as a whole!

renegadeandy said:

Sweet - removed the < from the material names and it works.

IS that a bug to be recognised with the sketchup exporter developers?

Does anybody have a community they can report this to?


I'd report it to the thread for the exporter on the OGRE forums here..  Someone else actually posted a problem that looks like it could be related about two weeks ago :)

renegadeandy said:

*apologies for coming across as rude - I am incredibly impressed with jME as a whole!*


No harm done, the same guy that made the OGRE decision is one of the folks that jumped in to help (Momoko)..  Again, there's no reason you couldn't working on porting your favorite jME2 importer to jME3 (or starting one for a previously unsupported format)