Exception information utility breakdown:
“I got an exception”: 1% of the useful information
Exception name: 1% of the useful information
Stack trace: 98% of the useful information
So you have left out 98% of the useful information… might as well have not mentioned the exception at all and said “it doesn’t work”.
@nehon, @pspeed, i have successfully saved the the sceneNode by adding write petmission. my problem now is loading the saved file i got an error:
SEVERE Exception thrown in Thread[GLThread 664,5,main]
java.lang.NullPointerException
at com.jme3.texture.Texture.read(Texture.java:614)
at com.jme3.texture.Texture2D.read(Texture2D.java:215)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.readSavable(BinaryInputCapsule.java:457)
at com.jme3.material.MatParam.read(MatParam.java:368)
at com.jme3.material.MatParamTexture.read(MatParamTexture.java:102)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483)
at com.jme3.export.binary.BinaryInputCapsule.readStringSavableMap(BinaryInputCapsule.java:667)
at com.jme3.material.Material.read(Material.java:1011)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.readSavable(BinaryInputCapsule.java:457)
at com.jme3.scene.Geometry.read(Geometry.java:630)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587)
at com.jme3.scene.Node.read(Node.java:743)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:242)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125)
at jme3tools.savegame.SaveGame.loadGame(SaveGame.java:184)
at jme3tools.savegame.SaveGame.loadGame(SaveGame.java:128)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo.load(GuiDemo.java:347)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo.access$1000013(GuiDemo.java)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo$100000005.execute(GuiDemo.java:315)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo$100000005.execute(GuiDemo.java)
at com.simsilica.lemur.core.CommandMap.runCommands(CommandMap.java:61)
at com.simsilica.lemur.Button.runClick(Button.java:333)
at com.simsilica.lemur.Button$ButtonMouseHandler.mouseButtonEvent(Button.java:410)
at com.simsilica.lemur.event.MouseEventControl.mouseButtonEvent(MouseEventControl.java:122)
at com.simsilica.lemur.event.PickEventSession.buttonEvent(PickEventSession.java:624)
at com.simsilica.lemur.event.TouchAppState.dispatchButton(TouchAppState.java:132)
at com.simsilica.lemur.event.TouchAppState$TouchObserver.onTouchEvent(TouchAppState.java:201)
at com.jme3.input.InputManager.processQueue(InputManager.java:837)
at com.jme3.input.InputManager.update(InputManager.java:907)
at com.jme3.app.LegacyApplication.update(LegacyApplication.java:725)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:227)
at com.jme3.app.AndroidHarnessFragment.update(AndroidHarnessFragment.java:577)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:336)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
Why are you saving the entire root node? SaveGame is not meant for that.
You have to create a Savable object that contains the relevant information needed to rebuild your game in the same state…
i just wanted to create a simple 3d modeller for engineering not a game. so i think i just have to save and load a scene with objects. all i want now is to reload the sceneNode i saved. @nehon, @pspeed
Please stop pinging me in every one of your post, I read the forum, I’ll see your post.
The problem here is that you have external assets.
What you could try is remove the textureKey on every texture, so that they are embed in the save file.
that’s basically go over all your materials, find all textures and do : texture.setTextureKey(null).
by texture.setKey(null) , the exception dissappeared. however, i encounter a new exception:
java.lang.NullPointerException
at com.jme3.material.Material.read(Material.java:1050)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.readSavable(BinaryInputCapsule.java:457)
at com.jme3.scene.Geometry.read(Geometry.java:630)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587)
at com.jme3.scene.Node.read(Node.java:743)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:242)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125)
at jme3tools.savegame.SaveGame.loadGame(SaveGame.java:184)
at jme3tools.savegame.SaveGame.loadGame(SaveGame.java:128)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo.load(GuiDemo.java:308)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo.access$1000013(GuiDemo.java)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo$100000005.execute(GuiDemo.java:276)
at org.jmonkeyengine.simple_jme_android.mylemurapp.GuiDemo$100000005.execute(GuiDemo.java)
at com.simsilica.lemur.core.CommandMap.runCommands(CommandMap.java:61)
at com.simsilica.lemur.Button.runClick(Button.java:333)
at com.simsilica.lemur.Button$ButtonMouseHandler.mouseButtonEvent(Button.java:410)
at com.simsilica.lemur.event.MouseEventControl.mouseButtonEvent(MouseEventControl.java:122)
at com.simsilica.lemur.event.PickEventSession.buttonEvent(PickEventSession.java:624)
at com.simsilica.lemur.event.TouchAppState.dispatchButton(TouchAppState.java:132)
at com.simsilica.lemur.event.TouchAppState$TouchObserver.onTouchEvent(TouchAppState.java:201)
at com.jme3.input.InputManager.processQueue(InputManager.java:837)
at com.jme3.input.InputManager.update(InputManager.java:907)
at com.jme3.app.LegacyApplication.update(LegacyApplication.java:725)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:227)
at com.jme3.app.AndroidHarnessFragment.update(AndroidHarnessFragment.java:577)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:336)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
k
by texture.setKey(null) , the exception dissappeared. however, i encounter a new bug