Using my code which happens to be in Eclipse, I can successfully import the Oto.mesh.xml and have him play his Walk animation. Looks great. Recently, I made my own custom model in Blender for JME3 and it has two animations: walk and run. I import the .blend in the SDK, convert to .j3o and the animations both work and look perfect! Then, I copy the .j3o and .j3o data files made by the SDK into my assets/models folder in Eclipse. I load the mode and attach it to the scene and it looks perfect, although it is in its base orientation with its arms sticking straight out. When I call the animation control to play an animation, the animControl says that only one of the two animations is not null. Furthermore, when I try to play this animation in a channel (with exactly the same working code with Oto) the model does not do anything! It remains in its base orientation, no animations like in the SDK. I am extremely confused… Do any of you have any ideas? Both the SDK and my Eclipse code are running 3.0 stable.
Upon testing further, I discovered that while the SDK always sees and plays both animations perfectly, the game only acknowledges that the animation that was active in Blender during the export is not null. The other animation, which was not active, is null according to the games animation control. This is EXTREMELY weird considering the SDK shows no such difference at all and does not care about that.
What works in the SDK works in JME.
Something else must be wrong.
What you describe (in eclipse) sounds like when you import with ogre and that you didn’t create NLA tracks in blender.
However if you manage to have the animations right in the SDK, i guess you did this somehow. Or aren’t you using Ogre? you’re using the blender importer?
Anyway…just to be certain…double check that you copy over to eclipse the same j3o that you use in the sdk,
I am not using Ogre at all, I am just putting the .Blend in the SDK and converting to .j3o. That may be the root cause of the issue, but I am sad and baffled that it all works perfectly fine in the SDK and then not in Eclipse. I agree that it is extremely weird, since I am quite certain that I am using the exact same JME3 libraries in both the Netbeans SDK and in Eclipse. I am also positive that I am using the same .j3o and .j3odata files from the SDK. I will try to use the Ogre exporter in Blender, even though that isn’t quite as convenient, and I will refresh Eclipse. The good (unrelated) news is that I got a weapon model to attach to the hand bone! So at least there is that… haha
Because you mentioned the Eclipse cache issue, the problem may be that I had older JME3 library files imported that are still being used. Even though I quickly tossed in the library files from the SDK and overwrote, I did not refresh the project. That may be the problem right there…
One thing I can say for sure: if you are using the same data file and the same copies of the jars then you will have the same behavior. I don’t think there is enough magic for it to be otherwise.
I fixed the issue! I was using a recursive function to check children of the model for AnimControls. For some reason, that function was returning a non-null AnimControl that was actually the incorrect AnimControl! I am not sure how this is possible… Once I specifically used node.getChild(“parentofanimcontrol”).getControl(AnimControl.class); Then it worked perfectly!