SharedNode problems

I have a scene with some jmexml models. A lot of these models are the same so I use the SharedNode. It's just that some weird scaling and rotations happen when I am creating a second (or more) SharedNode out of the original imported Node. I made a litte tree trace method to see what happend, it's printed from the bottom of the tree to the top.



I am using a old nightly build which was for download in this site about a year ago.



This is the first time I add the model, notice the SharedMesh.



Spatial name - local scale - local rotation


hospital01_SharedNodeCylinder.001.nocull (com.jme.scene.SharedMesh) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
hospital01_SharedNodeCylinder (com.jme.scene.Node) - com.jme.math.Vector3f [X=0.5176379, Y=1.0, Z=0.5176378] - com.jme.math.Quaternion: [x=0.0 y=1.0 z=0.0 w=0.0]
hospital01_SharedNodeXML loaded scene (com.jme.scene.Node) - com.jme.math.Vector3f [X=0.05, Y=0.05, Z=0.05] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
hospital01_SharedNode (com.jme.scene.SharedNode) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
ModelNode (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
objectPile (simworld.client.gui.objects.ObjectPile) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
block(2, 2) (simworld.client.gui.world.Block) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
world (simworld.client.gui.world.World) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
worldNode (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
root (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]




This is the second time added, again, note the SharedMesh


hospital01_SharedNodeCylinder.001.nocull (com.jme.scene.SharedMesh) - com.jme.math.Vector3f [X=0.025881896, Y=0.05, Z=0.02588189] - com.jme.math.Quaternion: [x=0.0 y=1.0 z=0.0 w=0.0]
hospital01_SharedNodeCylinder (com.jme.scene.Node) - com.jme.math.Vector3f [X=0.5176379, Y=1.0, Z=0.5176378] - com.jme.math.Quaternion: [x=0.0 y=1.0 z=0.0 w=0.0]
hospital01_SharedNodeXML loaded scene (com.jme.scene.Node) - com.jme.math.Vector3f [X=0.05, Y=0.05, Z=0.05] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
hospital01_SharedNode (com.jme.scene.SharedNode) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
ModelNode (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
objectPile (simworld.client.gui.objects.ObjectPile) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
block(1, 2) (simworld.client.gui.world.Block) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
world (simworld.client.gui.world.World) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
worldNode (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]
root (com.jme.scene.Node) - com.jme.math.Vector3f [X=1.0, Y=1.0, Z=1.0] - com.jme.math.Quaternion: [x=0.0 y=0.0 z=0.0 w=1.0]




This method is called twice to add the model.


public void addBuilding(Tile t, String type)    //'Tile' is a homemade class
    {
        Node modelNode = new Node("ModelNode");
        modelNode.setLocalTranslation(new Vector3f(0.0f, 0.25f, 0.0f));
        this.attachChild(modelNode);        //'this' is the objectPile node (see tree print above)
        Node model = (Node)ol.getObject(type);     //'ol' is the objectlibrary, where all models are stored, 'getObject()' see below
        modelNode.attachChild(model);
        //((Spatial)((Node)((Node)model.getChild(0)).getChild(0)).getChild(0)).setLocalScale(new Vector3f(1.0f, 1.0f, 1.0f));   // my ugly hack to fix the scaling problem for the moment
       
        modelNode.updateGeometricState(0.0f, false); 
        modelNode.updateRenderState();
        SWDebug.traceParents((Spatial)((Node)((Node)model.getChild(0)).getChild(0)).getChild(0));  //the tree trace
}




SharedNode is made here, called by the piece of code above, the second time I try this it goes awry


public SharedNode getObject(String name)
    {
        Node object = library.get(name);    //'library' is a HashMap<String, Node>
        if (object != null)
        {
            return new SharedNode((name + "_SharedNode"), object);
        }
        else
        {
            return null;
        }
    }

Just checked a bit further, the location is off aswell.