Blender to Collada

I'd like to start using the Collada format for my game models, however I am running into a problem with loading models exported from Blender using the export script from Illusoft.  I have a simple model (a square tile made up of two triangles) that I am trying to load using ColladaImporter, and I am getting the follow exception:



java.lang.NumberFormatException: For input string: ""
   at java.lang.NumberFormatException.forInputString(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at java.lang.Integer.parseInt(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processTriMesh(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processMesh(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processGeometry(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.processCollada(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.load(Unknown Source)
   at com.jmex.model.collada.ColladaImporter.load(Unknown Source)
   at net.rpgtoolset.engine.MainGameState.setupTerrain(MainGameState.java:222)



Below is a link to the Collada file and texture, any help would be appreciated.  Thanks!

http://www.zeromatrix.net/grass_tile.zip

dunno about collada blender's exporter yet -grab plugins allways from plugin author page, no the native-  but…test about selecting and leave selected the model before exporting, with a open 3d window, in blender…who knows.



cant tell you why I suspect this. But I have that suspiction.


I just successfully loaded your grass quad here with no modifications to the file.

I grabbed and compiled all of the latest jME packages and I am still running into the same problem.  I modified the test Collada loading source to this:


URL url = TestColladaLoading.class.getClassLoader().getResource("collada/");
InputStream tile = TestColladaLoading.class.getClassLoader().getResourceAsStream("collada/grass.dae");
ColladaImporter.load(tile, url, "model");



When it gets to the ColladaImporter.load line, it gives the follow error:


WARNING: Error processing geometry library information - java.lang.NumberFormatException: For input string: ""
java.lang.NumberFormatException: For input string: ""



I stepped through the processTriMesh method, and apparently it is throwing the exception at this line:


int set = Integer.parseInt(tri.getinputAt(i).getset().toString());


for this line of XML:


<input offset="1" semantic="TEXCOORD" source="#Cube-Geometry-UV"/>



Apparently it's trying to parse a "set" attribute that isn't there.  I added that attribute into my file (gave it a value of 1 just to see what would happen), and now the model will load and display correctly, but there is no texture... Any ideas?

perhaps we have some collada updates to check in here?

yeah, committed now.

Seems to be working as it should now, thanks for the help!

hello :wink:



another problem loading a mesh exported from blender.



INFO: LWJGLRenderer created. W:  1024H: 768

13.12.2006 13:51:34 com.jme.renderer.AbstractCamera <init>

INFO: Camera created.

13.12.2006 13:51:34 com.jme.util.lwjgl.LWJGLTimer <init>

INFO: Timer resolution: 1000 ticks per second

13.12.2006 13:51:34 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:34 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:34 com.jme.scene.Node attachChild

INFO: Child (FPS label) attached to this node (FPS node)

13.12.2006 13:51:34 com.jme.scene.Node <init>

INFO: Node created.

Version: 1.4.0

13.12.2006 13:51:35 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Tower_MESH) attached to this node (Tower_MESH-skin_node)

13.12.2006 13:51:35 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:35 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:35 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Tower) attached to this node (Scene)

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Tower_MESH-skin_node) attached to this node (Tower)

13.12.2006 13:51:35 com.jme.scene.Node <init>

INFO: Node created.

13.12.2006 13:51:35 com.jme.util.ErrorManager addError

WARNUNG: Bone Arm1 is not attached to any vertices.

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Arm1) attached to this node (Scene)

13.12.2006 13:51:35 com.jme.scene.Node detachChildAt

INFO: Child removed.

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Arm1) attached to this node (Scene)

13.12.2006 13:51:35 com.jme.scene.Node attachChild

INFO: Child (Scene) attached to this node (newModel)

java.lang.NullPointerException

at com.jme.animation.SkinNode.updateSkin(Unknown Source)

at com.jme.animation.SkinNode.updateGeometricState(Unknown Source)

at com.jmex.model.collada.ColladaImporter.optimizeGeometry(Unknown Source)

at com.jmex.model.collada.ColladaImporter.processCollada(Unknown Source)

at com.jmex.model.collada.ColladaImporter.load(Unknown Source)

at com.jmex.model.collada.ColladaImporter.load(Unknown Source)

at de.mistudios.test.TestObjectLoading.createObjects(TestObjectLoading.java:102)

at de.mistudios.test.TestObjectLoading.simpleInitGame(TestObjectLoading.java:73)

at com.jme.app.BaseSimpleGame.initGame(Unknown Source)

at com.jme.app.SimplePassGame.initGame(Unknown Source)

at com.jme.app.BaseGame.start(Unknown Source)

at de.mistudios.test.TestObjectLoading.main(TestObjectLoading.java:35)





the model can be loaded from here:

http://jxg.mi-studios.de/index.php?option=com_docman&task=doc_download&gid=1&Itemid=34



i use the code from colladaTest-class to load this model withour the "man_walk"-stuff.