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:
[java]
final Material soldier2Mat = assetManager.loadMaterial(“Materials/soldier2/soldier2.j3m”);
final Spatial soldier2 = assetManager.loadModel(“Models/soldier2/soldier2.j3o”);
TangentBinormalGenerator.generate(soldier2);
soldier2.setMaterial(soldier2Mat);
final Node soldier2Node = new Node(“Soldier2 Node”);
soldier2Node.attachChild(soldier2);
rootNode.attachChild(soldier2Node);
final AnimControl control = soldier2.getControl(AnimControl.class);
control.addListener(this);
final AnimChanel channel = control.createChannel();
final SkeletonDebugger skeletonDebug = new SkeletonDebugger(“skeleton”, control.getSkeleton());
final Material mat = new Material(assetManager, “Common/MatDefs/Misc/Unshaded.j3md”);
I downloaded the model from blendswap. I changed this model to use only one material with difusse, normal and specular textures.
On blenderguru 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 made a wiki page from this: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:external:blender It could still contain some more information about texture mapping etc. (no complaint to you @H, this is exactly the stuff we need) Maybe we can make similar pages for separate modeling tools as people looking for such information don’t really want a lot of general info woven into it I guess, we can keep that centrally in another place.
I’ll post some images showing the materials and textures applied to the model next week (I’m not at home this weekend (today -friday- is national holiday in Argentina, so it is a long weekend :D).
On blender, the model has one material with 3 textures: diffuse, specular and normal. To know more about materials, textures and uv mapping check Blender cgcookie, there are a lot of very good video tutorials.
Yeah thanks, gotta update the wiki with these. If anyone wants to do it, I don’t think I’ll have time during the day Just remember to actually upload the images to the wiki as else they won’t appear in the SDK manual.
@eriqadams: I’m using VERSION = ‘0.5.4’ of blender2ogre exporter. It’s the version that is included in jm3 beta release I think. Blender version: 2.62 (64bits).
You had opened ogrexml files that contains animations and had copied animation from one file to another.
I have same problem: all tracks are identical. I have to export same file many times. And then merge animations within ogrexml. It is quite bothersome if you had many animation tracks.