Deprecate JmeBinaryReader?

I'm converting over some of my old code to work with the newest version of jME and I have been struggling with some model loading code I wrote previously:


JmeBinaryReader jbr = new JmeBinaryReader();
jbr.setProperty("bound", "sphere");
node = new Node("Model");
jbr.loadBinaryFormat(node, model.openStream());



It used to work but now when it gets executed it an IOException is thrown:

java.io.IOException: Binary Header doesn't match.  Maybe wrong file?
   at com.jmex.model.XMLparser.JmeBinaryReader.readHeader(JmeBinaryReader.java:1272)
   at com.jmex.model.XMLparser.JmeBinaryReader.loadBinaryFormat(JmeBinaryReader.java:156)
   at com.captiveimagination.jme.LoadModel.simpleInitGame(LoadModel.java:55)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:466)
   at com.jme.app.BaseGame.start(BaseGame.java:56)
   at com.captiveimagination.jme.LoadModel.main(LoadModel.java:29)



My assumption is that the changeover from JmeBinaryReader to BinaryImporter caused this problem.  After switching my code to be:

BinaryImporter importer = new BinaryImporter();
node = (Node)importer.load(model);
node.setModelBound(new BoundingSphere());



Instead, it works fine again, but it makes me wonder what the purpose of JmeBinaryReader is anymore and if it shouldn't be deprecated or removed if it no longer works the same way as it used to?

Your issue is the same one we've talked about in the model loading threads (the one about switching from JBR to BI)  As for JBR, I wouldn't shed a tear to see it go away.  I think the only useful part of that old code is the XML stuff - being able to save out a scene in "human-readable" XML.  Once we made an extension of Importer and Exporter that did XML though, that excuse would also be gone. :slight_smile:

Yes, the XML part is still used by people who use hevee's blender script.

And those debugging loaders. I used the XML stuff when writting my AC3D loader.



Endolf