Duplicating loaded model

I am trying to implement a game using Collada for animated models. Within the game world I need to use an identical character several times. I could solve this by loading the same model several times, but that takes some time if the same model is used more than a couple of times. What I really would like to do, is to have a master model which I create copies of instead. Is it possible to do this in the current engine?

Try CloneImportExport. There is no test class demonstrating the usage, but it is really trivial:


            CloneImportExport cie = new CloneImportExport();
            cie.saveClone(masterModel);
            return (Spatial) cie.loadClone();

That does not seem to work for this model. I get the following stack trace:



java.lang.ArrayIndexOutOfBoundsException: 994
   at com.jme.util.CloneImportExport$CloneCapsule.writeSavableArrayListArray2D(Unknown Source)
   at com.jme.animation.SkinNode.write(Unknown Source)
   at com.jme.util.CloneImportExport.save(Unknown Source)
   at com.jme.util.CloneImportExport.access$000(Unknown Source)
   at com.jme.util.CloneImportExport$CloneCapsule.writeSavableArrayList(Unknown Source)
   at com.jme.scene.Node.write(Unknown Source)
   at com.jme.util.CloneImportExport.save(Unknown Source)
   at com.jme.util.CloneImportExport.saveClone(Unknown Source)
   at skunkworks.JmeTest.initGame(JmeTest.java:303)
   at com.jme.app.BaseGame.start(Unknown Source)
   at skunkworks.JmeTest.main(JmeTest.java:116)



It might be that the model is too complex for the clone method. I am using the collada model that has been used in the demos of JME, and I load the model with animations before I do a saveClone().