First Post! Here it is…
I'm trying to load a model exported from blender using hevee's script (thanks hevee). My loading routine has worked for me in the past (jme v.10) and I'm now using the nightly build, so I'm updating to use the new BinaryImporter.
I'm getting an IOException to the likes of:
Sep 25, 2006 9:37:05 AM com.jme.scene.Node attachChild
INFO: Child (FPS label) attached to this node (FPS node)
java.io.IOException: Not in GZIP format
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at java.util.zip.GZIPInputStream.<init>(Unknown Source)
at com.jme.util.export.binary.BinaryImporter.load(Unknown Source)
at src.TestBinaryXML.loadFromXML(TestBinaryXML.java:123)
at src.TestBinaryXML.simpleInitGame(TestBinaryXML.java:66)
at com.jme.app.BaseSimpleGame.initGame(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at src.TestBinaryXML.main(TestBinaryXML.java:61)
at src.Main.main(Main.java:16)
when loading. I noticed the the TestBinaryXML in the src still uses the JMEBinaryReader, so I replaced it with my own method for testing.
Here's my code:
loadFromXML(String file) {
Node model = null;
try {
URL url = TestBinaryXML.class.getClassLoader().getResource(file);
ByteArrayOutputStream BO = new ByteArrayOutputStream();
new XMLtoBinary().sendXMLtoBinary(url.openStream(), BO);
model = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
}
catch(IOException e) {
e.printStackTrace();
}
return model;
}
I've scoured the forum and can't seem to solve this! I hope its a simple solution, thanks.
ps - For hevee, I have your latest version exporter for jme xml, I noticed in one recent post you had "hacked" a fix for something but didn't test the animation. Well I was playing with the animation export and was getting an error for 'fps' referenced before declaration, I fixed it in mine, if you search for the first occurance of fps you should find it. Awesome tool, thanks!