Problem when exporting template and animation created in blender

I think the problem is between blender and jme. I will send a file with some prints with the problem and the file in blender format.


Here is the link … I delayed because the internet (mobile), was quite slow, only now improved.

I made a simple animation of a rolling monkey. When I exported to ogre, it gave this problem. I do not know if turning straight from .blender format to .j3o will work.

I obeyed the “rule” that the animation must contain bones, when I made a boneless animation, I can export normally, but without the skeleton file.

Even without a bone, the problem occurs!

How do I do that?

Ok … I gotta solve (in parts) my problem … I saw the tutorial to get a model and do animation (link: https://hub.jmonkeyengine.org/t/tutorial-cadnav-to-mixamo-to-jme-workflow/35356). I think I understood what DarkChaos meant about the submodel. And my code looks like this:

Node nod=(Node) assetManager.loadModel(//File);
Spatial spt=nod.getChild(0);
rootNode.attachChild(spt);
control=spt.getControl(AnimControl.class); // AnimControl control=null

The remainder is the default procedure, creates AnimChannel, and so on.
Now when I run the animation, the camera moves down, and it stops. (I know the animation is running because I put it to show a message when the animation closes.

So… now your problem is…

???

If so, that’s because you have attached somehow the camera to any node following any bone. Can you post your code?

OK, wait a minute.

https://www.dropbox.com/s/yboc03boslesm21/BasicGame.zip?dl=0
I sent the folder containing everything, because I’m a little desperate.

I’m not sure what is supposed to do but the anims are clearly not working. You are using the 3.0 version so first of all I suggest you to try the 3.1 (the importer has many updates).

Another suggestion is, before trying them in the scene try the animations first in the “scene composer”. When you add the model to the model folder and <right click> -> convert to j3o Binary", the j3o is generated in the same folder. <Double click> that j3o or <right click> -> edit in SceneComposer. The “scene explorer” should be opened too (down left, normally).

  • Open the tree untill you arrive to the AnimControl, open it too.
  • Now, <double click> or <right click> -> play on the desired animation. If it works, go on with the code, if not, check what is missing in blender to have it detected by the importer.

PD: In 3.1 the model is doing a movement (but I don’t know if it is a good one)

I am using the version 3.0, i will try to use 3.1.

At least the animation performed



nod = (Node) assetManager.loadModel(“Models/valet/valet.j3o”);

    Node no =(Node) nod.getChild(0);
    Spatial spt=no.getChild(0);
    
    DirectionalLight sun = new DirectionalLight();
    sun.setDirection((new Vector3f(-0.5f, -0.5f, -0.5f)).normalizeLocal());
    sun.setColor(ColorRGBA.White);
    rootNode.addLight(sun);

    rootNode.attachChild(spt);
    controle = spt.getControl(AnimControl.class);
    System.out.println(controle);
    if (controle != null) {
        System.out.println("carregou!");
        controle.addListener(this);
        canal = controle.createChannel();
        canal.setAnim("swagger_walk_inPlace");
    }

Thanks for the effort, NemesisMate and DarckCaos. I’ll try a new template to see if the animation will run differently.

I think there is no way … I tried with another model with another animation but there are moments that the animation does not run or sometimes it runs but bugada.
I upgraded to the new version (3.0.1) and got to run it, but left as you can see in the posts above. I’ll wait for new versions of JME to get back to work.
PS: I think the blender file has no problems, as I followed the CardNav tutorial.

The latest available version for SDK is 3.1-beta2.

I will try

Ok … Many bugs in SNAPSHOT (Of course) … Anyway, due to a bug in opening the SceneComposer, I could not do a deep check on the file generated by the SDK. But the valet.j3o file, generated by SDK 3.1.0, ran smoothly (I’ll do some more testing), but two other files (I used the same procedure to do the animation) did not run. Well I will do more tests with this version with other models so that I can finally give a verdict.

Ps .: I’m noob in JME and Blender, but I have a lot of experience in java.

I waited until I released the stable version … I did some tests and it seems that it worked … even with multiple animations. Well I think the topic will not be updated. Thank you all for the effort, I think I even had to give time to the time.

1 Like

There is a bug fix in new release regarding bone cloning, thanks to pspeed .
It will make lot’s of people happy with animation working. :wink:

1 Like