This tutorial was made using Blender version 2.43. It is an example of exporting a simple animated object with one bone.
There appears to be two loaders for .md5 models, one at Java.net and one at SourceForge
As far as I know the more advanced and supported one is option 2 from sourceforge, but they both work.
1.right-click on jme-contrib→kproject-md5 and select 'check out as…' then check out as a new Java project using the new project wizard.
2.Now right click on project→properties→Java build path→projects tab→add and add jme project to build path.
3.Also in Java build path, click the Source tab→Add folder… and add both 'kproject-md5/src' and 'kproject-md5/src-jme'. In addition, add 'kproject-md5/data' to properly load test data. You may have to edit the 'kproject-md5/data' folder to be simply 'data' if you get a blank screen and errors upon running JmeMD5Test. Project is now ready.
4.Run the test 'JmeMD5Test' in src-jme to confirm that it works.
cvs -d:pserver:anonymous@md5reader.cvs.sourceforge.net:/cvsroot/md5reader login
Hit enter when asked for password.
cvs -z3 -d:pserver:anonymous@md5reader.cvs.sourceforge.net:/cvsroot/md5reader co -P md5reader2
or in Eclipse:
The model used in this tutorial is a textured sphere created in Exporting .obj Models From Blender
1.In object mode hit spacebar→Add→Armature
2.In object mode select the sphere then shift-select the armature so that they are both selected
3.Hit ctrl-p→Armature→Create From Closest Bones
4.In edit mode hit 'a' to select all vertices, on Link and Materials tab under 'Vertex Groups' click 'assign' to assign verticies to bone
(model can be exported w/o animation after this step, skip to step 7)
5.In object mode select the armature(bone) then enter pose mode. Then change screen to SR:1-Animtion
6.Hit 'i'→LocRot to insert the first keyframe then skip to frame 11, rotate model(r key), and hit 'i'→LocRot again.Go back to SR:2-Model
7. (This step is only necessary when using code from jme-contrib)
With sphere selected in edit mode hit shift-ctrl-n to recalculate normals inside(this may not be necessary), save the file as a .blend.
(I've found that saving as .blend applies the changes to normals otherwise they dont get flipped when exporting.)
8.Export model as .md5 File→Export→Doom3 MD5, just select a location for your model and animation to export to and export it!
9.Load into JME, dont forget to put your texture(s) in the right location, and youre done.
10.You are most likely going to need to edit the <shader ””> line in .md5mesh file, see troubleshooting.
o
-|-
^
bodyInstance.addChild( head, "Shoulders" );
see MarineTest in MD5Reader2 the head is attached to “Shoulders” bone.
runningAnimator.fadeOut(.1f, false); standingAnimator.fadeIn(.5f); standingAnimator.fadeTo(0,1);
you'll have to experiment with the right methods and numbers to get your animations looking perfect.
The loader cant find your texture.
bodyInstance.setNormalsMode(SceneElement.NM_GL_NORMALIZE_PROVIDED)
frame.positions[it] = new Vector3f(tz, ty, tx)
to:
frame.positions[it] = new Vector3f(tx, ty, tz)
in both lines the animation will be properly rotated.
This fixes the blender animation, but the sarge walking animation supplied with the code walks to the right insted of forward so this isnt a real fix.
return TextureManager.loadTexture( url, Texture.MM_LINEAR_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true );
Geometry geom=(Geometry)instance.getChild(0);
for(int x=0;x<geom.getBatchCount();x++) {
geom.getBatch(x).setHasDirtyVertices(true);
}
Blender
Animation tutorial
Blender wikibooks
good luck