Need help for .3ds animation

1) I made a keyframe-animator model on 3dsmax and export to .3ds format, i follow the downloaded source code examples "renderer.loader", but i find that my model only loop once and then stop....

2) for milkshpae model, if i make it too big, it cannot be loaded, the console said : "unknown source";

can anyone help?

public class Maxzhulei extends SimpleGame {
URL modelpath = null;
public static void main(String[] args)
    {  Maxzhulei app = new Maxzhulei(); if (args.length > 0) { app.setModelToLoad(args[0]); }
        app.start(); }
private void setModelToLoad(String string)
        { try { modelpath = (new File(string)).toURL();} catch (MalformedURLException e){ }    }

protected void simpleInitGame() {
        if (modelpath == null) {modelpath = Maxzhulei.class.getClassLoader().getResource("feiji.3DS");}
        try {
            MaxToJme change = new MaxToJme();
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            change.convert(new BufferedInputStream(model.openStream()), output);
            Node jiedian = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(output.toByteArray()));
            if (jiedian.getChild(0).getControllers().size() != 0) jiedian.getChild(0).getController(0).setSpeed(20);
            Quaternion rotate = new Quaternion();
            rotate.fromAngleAxis(FastMath.PI / 2, new Vector3f(-1, 0, 0));
            jiedian.setLocalTranslation(new Vector3f(0,0,0));
            rootNode.attachChild(jiedian); }
            catch (IOException e) {System.out.println("Damn exceptions:" + e);e.printStackTrace();}


I know that this post is almost 2 years old, but I came across the same problem and fix hopefully it will save you 20 minutes of debugging…

After printing out the 3ds model structure i found out that the controller for my 3ds animation is on the top level.

The example loader assumes the controller is in the first child, but that is not the case for my model, and probably other 3ds models. code:

if (r1.getChild(0).getControllers().size() != 0)


corrected code

Node r1 = (Node)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));

ArrayList<Controller> al = r1.getControllers();

if (al.size()>0){

Controller c = al.get(0);








printout example:

head:TDS Scene (com.jme.scene.Node)controllers:1