Problem saving MeshCollisionShape

Having a problem saving an object after applying a MeshCollisionShape.



[java]java.lang.UnsupportedOperationException

at java.nio.ByteBuffer.array(Unknown Source)

at com.jme3.bullet.collision.shapes.MeshCollisionShape.write(MeshCollisionShape.java:113)

at com.jme3.export.binary.BinaryExporter.processBinarySavable(BinaryExporter.java:376)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:721)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:274)

at com.jme3.bullet.collision.shapes.infos.ChildCollisionShape.write(ChildCollisionShape.java:37)

at com.jme3.export.binary.BinaryExporter.processBinarySavable(BinaryExporter.java:376)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:721)

at com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(BinaryOutputCapsule.java:758)

at com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(BinaryOutputCapsule.java:346)

at com.jme3.bullet.collision.shapes.CompoundCollisionShape.write(CompoundCollisionShape.java:139)

at com.jme3.export.binary.BinaryExporter.processBinarySavable(BinaryExporter.java:376)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:721)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:274)

at com.jme3.bullet.collision.PhysicsCollisionObject.write(PhysicsCollisionObject.java:303)

at com.jme3.bullet.objects.PhysicsRigidBody.write(PhysicsRigidBody.java:703)

at com.jme3.bullet.control.RigidBodyControl.write(RigidBodyControl.java:239)

at com.jme3.export.binary.BinaryExporter.processBinarySavable(BinaryExporter.java:376)

at com.jme3.export.binary.BinaryOutputCapsule.write(BinaryOutputCapsule.java:721)

at com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(BinaryOutputCapsule.java:758)

at com.jme3.export.binary.BinaryOutputCapsule.writeSavableArrayList(BinaryOutputCapsule.java:346)

at com.jme3.scene.Spatial.write(Spatial.java:1290)

at com.jme3.scene.Node.write(Node.java:588)

at com.jme3.export.binary.BinaryExporter.processBinarySavable(BinaryExporter.java:376)

at com.jme3.export.binary.BinaryExporter.save(BinaryExporter.java:185)

at com.jme3.export.binary.BinaryExporter.save(BinaryExporter.java:336)[/java]



Is there a way for me to disable the saving of collision shapes? When I load the model, I generate collision shapes so don’t need them persisted.

Saving mesh collision shapes works fine here, always has. Can you make a test case of what you do?

Tried putting together a simple test case since my scenario is really complex, but the simple version works just fine. After looking closer at the stack trace, I can see that it’s trying to export everything that the PhysicsSpace has a reference to even though all I’m trying to save is a single node in a much larger tree. I tried cloning my node to have a Node not on the rootNode tree, but it’s still saving the PhysicsSpace.



I really just need to save the Mesh’s, I don’t need anything else. After I clone the node, how do I detach the PhysicsSpace and the MeshCollisionShape from my cloned node? They are just going to make the file bigger and I really don’t want them saved.

Sorry, just found it. Removed my RigidBodyControl from the cloned node and it saved.