Preparing a Character for XreaL
Requirements
At this present moment to get working normal maps requires an SVN version of Blender. Which can be downloaded at: http://www.graphicall.org/builds/index.php
It is not recommended you use the BlenderSVN for modelling & animating your characters.
MD5 import/export scripts Can be located here: http://xreal.svn.sourceforge.net/viewvc/xreal/trunk/xreal/blender/ Only require: md5_export.py & md5_import.py Place the script in your ".blender" directory.
Preface
This tutorial expects you have basic knowledge & understanding of the Blender interface. How to model, rig & animate. For more information on the Basic of Blender check out Blender wiki, Noob to Pro.
I'll be using the xsarge model as reference for this tutorial.
Creating characters in the md5 format is really easy, especially when compared to the old .md3. However if you have ever attempted character modelling in .md3 you'll notice some similarities between them.
Preparing The Rig
As you'll notice Xsarge is broken up into 2 sections. SargeHead & SargeBody The head is separate from the body as it points in the direction the camera is facing. For this to work & too determine where the waist is, we require some "control bones". These names can change if you modify the "character.cfg" For now though they are: "neckcontrol", "chest", "origin", & "Torso". There positions are very important.
NOTE: Look at the axis of "neckcontrol" notice it's different from the other bones. In view(NUMPAD 1) you'll see that the y-axis sticks out to the left, x-axis upwards, & z-axis forwards. It's impossible to change the Bones angles to that in Edit Mode, so you need to manually change the bones position in "Pose Mode". This is required to allow the head to properly follow the camera.
NOTE: The position of the origin bone being level with the foot.
The "Control Bones" parenting is pretty simple.
"neckcontrol" parent to "Spine.3" "chest" parent to "Spine.2" "Torso" parent to "Main_Torso" "Spine.3" parent to "Torso"
"Main_Torso" parent to "origin"
The last things required for a fully working rigg is the Attachment Tags. These are just bones with specific names to allow weapons to be equipped.
GNT_ATTACHER: located at the tip of Arm.2_R
With that done you have a fully working rigg to use in xreal.
HINT: When creating a new rigg, & setting it up before you start animating it is best to export the character to make sure he looks right in game.
Animating
To have a fully working character, xreal requires 13 separate animations. To keep it simple I recommend you keep with the naming convention I have used and the same amount of frames per animation.
This will require the Action Editor Window, create a new "Data Block/Action" per animation.
Crouch >> 41 frames
Crouch_Forward >> 49 frames
Fall >> 11 frames
Gauntlet_aim >> 75 frames
Gauntlet_fire >> 11 frames
idle >> 75 frames
jump >> 8 frames
machinegun_fire >> 5 frames
run >> 16 frames
Soft_Land >> 11 frames
taunt >> 26 frames
walk >> 18 frames
walk_backwards >> 18 frames
The Crouch_Forward, walk, & walk_backwards requires the animation to be moving in there required direction. This is primeraly to reduce the dreaded sliding effect.
If you haven't done already I recommend downloading the xsarge source and taking a look at the separate animation cycles. To get an understanding of what each one does.
Exporting:
Exporting to .md5 is fairly simple.
This requires md5_export.py, run the script & you'll be greeted with a window.
I'll go through each section of exporting.
Scale: If you've followed the typical size of a Blender character then your model will be extremely small in xreal. Use the Scale bar to increase the characters size without having to manually do it. Xsarge uses a Scale of 8.0, so if you character is roughly the same size I suggest that scale.
First Frame:Used to determine what the starting frame is of a particular animation. For example Xsarge "walk" starts at 1.
Last Frame: Used to determine what the end frame is of a particular animation. For example Xsarge "walk" ends at 18.
Export Action: This tell the script what action to export. For example I would enter "walk" if I want to export the walk animation.
MD5Mesh file: Directs the script to where you want the mesh to be saved. This requires to be named body.md5mesh
MD5Anim file: Directs the script to where you want the animations to be saved.
Animations are stored separately in xreal. Requiring specific names for the different animations.
crouch.md5anim
Export Action: Crouch
crouch_walk_backwards.md5anim
Export Action: Crouch_Forward
crouch_walk_foward.md5anim
Export Action: Crouch_Forward
fall.md5anim
Export Action: Fall
gauntlet_aim.md5anim
Export Action: Gauntlet_aim
gauntlet_fire.md5anim
Export Action: Gauntlet_fire
idle.md5anim
Export Action: idle
jump.md5anim
Export Action: jump
machinegun_fire.md5anim
Export Action: machinegun_fire
run.md5anim
Export Action: run
soft_land.md5anim
Export Action: Soft_Land
taunt_1.md5anim
Export Action: taunt
walk_backwards.md5anim
Export Action: walk_backwards
walk.md5anim
Export Action: walk
Remember to change the Last Frame for each action. If you don't you'll get some odd problems when in game.
