Updated (June 1st 2012): Fix points 1 and 2.
I've been working on import a model with animations into jMonkey. During this process I've experienced the same common problems that a lot of people had when they are working with animations on jMonkey (mesh twisted, animation deform the mesh in a wrong way, etc).
I saw that there are several topics about animations problems on the forum and I recolected some tips that helped me to solve my animation's problems. Thank you for your help by the way
I thought that it's a good idea to put all those tips that are scattered on the forum in one place (Perhaps these tips can be move to the documentation section. Feel free to do it if you consider these tips correct and add more tips also).
1.- Apply Location, Rotation and Scate to the mesh on Blender: On 3D View editor on Blender, select the mesh in Object Mode and go to the 3D View Editor's header -> Object Menu -> Apply -> Location / Rotation / Scale.
2.- Apply Location, Rotation and Scate to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor's header -> Object Menu -> Apply -> Location / Rotation / Scale.
3.- Set the mesh's origin point in the bottom of the mesh (see the images bellow).
4.- Set the armature's origin point in the bottom of the armature (see the images bellow).
5.- Armature's origin point and mesh's origin point must be in the same location(see the images bellow).
6.- Use a root bone located in the armature's origin. This root bone must be in vertical position (see the images bellow) and it is the root bone of the armature. If you rotate the root bone, the the entire armature might be rotate when you import the model into jMonkey (I'm just mentioning the result, I don't know where is the problem (jmonkey importer or blender's ogre exporter plugin)).
7.- Uncheck "Bone Envelopes" checkbox on the Armature modifier for the mesh (see the images bellow).
8.- Uncheck "Envelopes" checkbox on the armature (see the images bellow).
9.- User SkeletonDebugger to show the skeleton on your game in order to check if the mesh and the skeleton are loaded correctly:
final Material soldier2Mat = assetManager.loadMaterial("Materials/soldier2/soldier2.j3m");
final Spatial soldier2 = assetManager.loadModel("Models/soldier2/soldier2.j3o");
final Node soldier2Node = new Node("Soldier2 Node");
final AnimControl control = soldier2.getControl(AnimControl.class);
final AnimChanel channel = control.createChannel();
final SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton());
final Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
These two videos are very useful too. They show how to set the animation name.blender to jme3 though ogre XMLAnimations in Blender 2.61 and JME3
I downloaded the model from blendswap
. I changed this model to use only one material with difusse, normal and specular textures.
you can find a complete Introduction to Rigging Tutorial
made by Lee Salvemini (the page is not working right now, but it should by online in short period of time).
I hope this can help for the new people.