I've tried all sorts of things to get this to work, but whenever I try to use the built in ObjToJme converter, I keep getting the following error:
java.lang.ClassCastException: com.jme.scene.TriMesh
at spaceops.TestObjJmeWrite.simpleInitGame(TestObjJmeWrite.java:71)
at com.jme.app.BaseSimpleGame.initGame(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at spaceops.TestObjJmeWrite.main(TestObjJmeWrite.java:57)
That's with the example in the jmetest section (from CVS). It'll work with the obj files in the cvs tree, but not with any other I've thrown at it. I've told Blender to translate everything to triangles and whatnot, but still no luck. Is this a bug? Or am I just doing something wrong?
Ok… starting at line 261, here's a couple of changes I made so that the texturing works kind of like the mtllib setup:
Texture t = new Texture();
t.setWrap(Texture.WM_WRAP_S_WRAP_T);
URL texURL = new URL((URL)properties.get("texurl"), s.trim().substring(7));
t.setImageLocation(texURL.toString());
curGroup.ts.setTexture(t);
curGroup.ts.setEnabled(true);
return;
This way, the user can set the "texurl" property just like the "mtllib" property.
Update: This does set the texture path properly, and the texture is loaded. However, I'm getting "WARNING: Texturekey is null, cannot load". Where and how do you enable the texture key in the TestObjJmeWrite.java example?