[Solved]Export/import problem

I exported all my textures and models to binary files in advance. so i dont have to give my source model/texture files to other users.



but i cant seem to load them on a different computer from the one i converted/exported them.



i get a fileNotFoundException. and apparently the importer is trying to locate the texture/model files with the location on the original computer.



lets say my original files r located at c:sourceFilestexturestex.jpg then i exported them with binary exporter. and i copied the exported binary files to another computer. then the importer still looks for the old "c:sourceFilestexturestex.jpg" location.



how do i solve this.

Setting up a ResourceLocator pointing to the correct texture location should help if I understand your situation.  See the recent threads on release 1.0rc1 for details.

renanse said:

Setting up a ResourceLocator pointing to the correct texture location should help if I understand your situation.

i tried to load the .bmp/.jpg image files with binary importer, and it gives me an IOexception saying that the file is not in gzip format.



how can i convert these image files into binary files?

What's the stack trace?  Did you use the old JmeBinaryExporter to create these things?

thx alot for ur info.



i solved the problem.



ill do more test then ill post the model cnverter and texture converter classes

ok, so heres what i wanna do.



i wanna convert all my .bmp/.jpg files into binary files and convert all my .obj/.3ds files into binary files. and then i wanna just give these converted binary files to another user on a different computer. and that user needs to be able to load all these binary files without any problems.



the image files r fine now. but the models cant locate their textures.

heres what ive done.


  1. i set the "mtllib" and "texdir" to the same url as the original .obj/.3ds file.
  2. i load in the .obj/.3ds file with converter + binary importer and store it as a node.
  3. i export the node to a binary file with binary exporter.



    heres the problem.



    the models can be loaded but the binary importer is still looking for the old directory. and i got this exception



java.io.FileNotFoundException: C:Documents and SettingsNeakorMy DocumentsProjectSource CodeLightAndDarkdatamodelsBS_Plant_Tree01.tga
   at java.io.FileInputStream.open(Native Method)
   at java.io.FileInputStream.<init>(FileInputStream.java:106)
   at java.io.FileInputStream.<init>(FileInputStream.java:66)
   at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
   at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
   at java.net.URL.openStream(URL.java:1009)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:442)
   at com.jme.util.TextureManager.loadImage(TextureManager.java:424)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:327)
   at com.jme.util.TextureManager.loadTexture(TextureManager.java:296)
   at com.jme.image.Texture.read(Texture.java:977)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:249)
   at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:446)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:434)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:538)
   at com.jme.scene.state.TextureState.read(TextureState.java:725)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:249)
   at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:446)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:434)
   at com.jme.scene.SceneElement.read(SceneElement.java:853)
   at com.jme.scene.Spatial.read(Spatial.java:822)
   at com.jme.scene.Geometry.read(Geometry.java:840)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:249)
   at com.jme.util.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:446)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:434)
   at com.jme.util.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:538)
   at com.jme.scene.Node.read(Node.java:650)
   at com.jme.util.export.binary.BinaryImporter.readObject(BinaryImporter.java:249)
   at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:155)
   at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:172)
   at com.jme.util.export.binary.BinaryImporter.load(BinaryImporter.java:167)
   at lightAndDark.utility.loader.ModelLoader.load(ModelLoader.java:40)
   at lightAndDark.utility.loader.ModelLoader.loadWithPosition(ModelLoader.java:62)
   at lightAndDark.test.TestSkyDome.setupModel(TestSkyDome.java:59)
   at lightAndDark.test.TestSkyDome.simpleInitGame(TestSkyDome.java:50)
   at com.jme.app.BaseSimpleGame.initGame(BaseSimpleGame.java:503)
   at com.jme.app.BaseGame.start(BaseGame.java:69)
   at lightAndDark.test.TestSkyDome.main(TestSkyDome.java:24)