The short summary is:
- Create your model mesh object
- Add an armature (skeleton)
- Tell Blender that you want to use that armature
- Make that armature the parent for each mesh that you want to animate.
- Assign bone weights to the mesh by weight painting or adding bone vertex groups.
- Create animations
The initial steps must all be done BEFORE you start creating the animations otherwise you might have problems exporting those animations. The animations still work in Blender but it may be impossible to export them and you will have to recreate the animations!
An armature is the skeleton used to pose the model. I won't go in to detail here about that as this article is about the prerequisites of animations not the animations themselves.
Create the skeleton by adding bones.
When you name any object especially bones it is worth avoiding the decimal point '.' (period, dot or full stop.)
Blender is happy with a full stop but the FBX exporter will rename it to an underscore '_'. For example, 'Arm.R' becomes 'Arm_R' in the FBX file.
More Than One Way
This is where it starts to get complicated because there are multiple ways to do the same thing. I will explain, what I call, the manual process first and then mention the shortcut method at the end.
Blender needs to know which armature is used with which object. Simply select the object mesh you want to animate and add an armature modifier with the desired armature.
This is done in Object mode. You do NOT need to apply the modifier. It is just used like a note to Blender so it knows what links to what.
It is common to name the Armature 'Armature' and that can be a bit confusing because that is also the name of the modifier to add. I tend to rename my armatures but as most new users leave the name as 'Armature' I have done that for this screenshot.
The modifier panel is on the right and the name of the skeleton is shown in the 'Object:' box. In this case it is called 'Armature' and the mesh to which it is being added is called 'Cube'.
For animations to export correctly it is also necessary for the armature to be set as the parent for any object mesh that you want to animate.
Initially the mesh will not have a parent.
Again, in object mode with the object mesh selected. Go to the Relations panel and change the parent to the name of the armature you want to use.
Same example as above, the object is called 'Cube' and the armature is called 'Armature'.
When you animate a model with bones you need some way to tell the model which vertices to deform depending on which bones you move. That is called assigning bone weights. The techniques for doing that are way beyond this summary post. There are some links to articles about how to assign weights on my tutorials page:
I find I keep adjusting the bone weights, even after creating the animations, to improve the results. For complex models I find that manually assigning the vertices to vertex groups is the more reliable method rather than using the pretty paint brush style Weight Paint method.
The above methods of 'Add the modifier', 'Parent the armature' and Weight paint' can be done in one go using the Parent function.
In Object Mode, select the Object you want to animate, shift-select the armature and press Ctrl-P to parent the Armature to the Object. Select one of the weight paint methods from the list that is displayed and job done.
I find this useful for getting started or for very simple models but invariably I have to adjust the weight painting.
Whatever method you use you can go on to create animations.
With the armature selected you can change to pose mode and create animations. These must be saved as actions using keyframes. Press 'I' and from the popup menu select 'LocRotScale' to save each keyframe.
Use the ActionEditor view to see and edit a list of the keyframes saved.
The Action Editor is often hidden because it is on a separate menu on a toolbar. Change the option to Action Editor to see the list and change animations.
With the above settings done first it should be possible to export the animations for use in XNA.
I have a another post about that:
Multiple animations in one FBX file is possible with Windows Phone SDK v7.1 but there might be a problem:
And the Blender Wiki instructions:
Discussion thread on the XNA forums: http://forums.create.msdn.com/forums/p/68149/521975.aspx#521975
I'd like to thank Ernest Poletaev for pointing out that the mesh had to be parented to the armature and reminding me to include weight painting in the list.
Thanks to Gary Haussmann for pointing out that decimal points will be replaced by the exporter.