Cal3d shared node animations

Hello all,



I started playing with kman's cal3d loader and shared nodes.



I can have quite a few models on screen using shared nodes but animations seem to get lost.



Is there anyway to animate the cal3d models with shared nodes?



Thanks.

After playing with it some more maybe it's just my limited knowledge of shared nodes. I've modified the cal3d test code to give an example:


import com.jme.app.SimpleGame;
import com.jme.scene.SharedNode;
import com.jme.scene.state.LightState;

import gr.kproject.cal3dj.core.CalLoader;
import gr.kproject.cal3dj.jme.*;


public class JmeCalTest extends SimpleGame{
   
    public JmeCalTest() {
        setDialogBehaviour(ALWAYS_SHOW_PROPS_DIALOG);
        start();
    }
   
    public static void main(String args[]){
        new JmeCalTest();
    }

    protected void simpleInitGame() {
        //turn off lights to see the models
       rootNode.setLightCombineMode(LightState.OFF);
       
        //load in the model
        CalLoader.setLoadingMode(CalLoader.LOADER_INVERT_V_COORD);
        JmeCal3dNode jmeNode = JmeCal3dLoader.getJmeCal3dModel("test","data/cal3d/monster.xml");
        jmeNode.updateRenderState();
       
        //create the first shared node pointing at the model
        SharedNode sn = new SharedNode("test",jmeNode);
        //attach the animations to the shared node
        sn.addController(jmeNode.getCalController());
        ((JmeCal3dController)sn.getController(0)).setAnimation("walk");
        rootNode.attachChild(sn);
        //create 49 more shared nodes using the model - but don't attach animations
        for(int i = 0; i < 49; i++) {
           sn = new SharedNode("test"+i,jmeNode);
                //this is always zero - but it still animates
                System.out.println("controllers: "+sn.getControllers().size());
                //offset the model a bit
           sn.getLocalTranslation().set(15*i, 0, 0);
           rootNode.attachChild(sn);
        }
    }
}



After running this, even though I've only added a controller to the first shared node, all 50 of them will be animated. However, there doesn't seem to be any controllers in the new shared nodes.

Anyone have any ideas on what I'm doing wrong? I'll contiune to fiddle with it as I get time.

Thanks.