DtheHun
Sergeant Knight
The official Blender Exporter has been released. I have read the replies, and I sadly understood that many of us think that Blender's only avail was making static meshes till now, because of old scripts. This spring, I have written a tutorial to Daydream team members, about how to make animations in Blender, and how to get them to Mount&Blade v1.11. Maybe some parts of this tutorial will be useful to you too, although it is not for the new official exporter script. The animation itself is figurative, as the method is complex enough. My english is far from perfect, I am better with arrows. There will be many of them in the pictures, so I hope you can read them.
Here is what you need:
Blender2.49b: http://download.blender.org/release/Blender2.49b/
note: With higher blender versions (2.5 and above), these sripts are not working. However , you can have multiple Blender versions installed. I prefer modeling in 2.5, animating and exporting finished models in 2.49.
OpenBrf: http://www.mbrepository.com/file.php?id=1466
ModuleSystem v1.010: http://www.mbrepository.com/file.php?id=1694
BRF Export script by Dirk Schulz,
Bake Constraints script by Roger Wickes,
and skeletons (.blend) ready for animation are here:
http://web.t-online.hu/findadezso/surrealarms/mb_animacio.zip
You get two kind of skeletons. One with Forward Kinematic chain, and another with my Inverse Kinematic setup. Here is the difference:
I. Animate
We are going to set up a new sword combat stance. Open skeleton_IK.blend.
Make sure that you are in Pose Mode.
Select abdomen and the two IK_Foot bones [Shift + Right click]
Rotate them on Z axis [R + Z + (move mouse, or use Num buttones and write -75), Right Click to apply the rotation]
This will be the first frame. (1 sec=25 frame)
Rotate [R], and Move [G] bones to set up something like this.
[Alt G, Alt R] - clears the Location/Rotation.
[N] - open Transform Properties
IK controlled bones sometimes do not chose the right direction to rotate, but you can help them by rotating the thigh bones.
Press [A] to select all bones, then press (I) and select LocRot to save this pose.
Go forward in the timeline to frame 15 [Right Arrow]
Sink the abdomen on axis Z to make the crouch deeper. Rotate the legs or move the helper bones if the angles turns out.
You can also play with the upper body if you want to make the stance more flimsy.
Press [A] to select all bones, then press (I) and select LocRot to save this pose on the 15. frame.
Now go back to the first frame [Left Arrow]. Copy the pose.
Go forward to frame 25. Past the pose.
Every bone is selected, so press (I) and select LocRot to save this pose on the 25. frame.
Open the Timeline menu, set the end frame to 25, play your animation.
Go to Action Editor view. Good place to edit the lenght of the stance by moving the dots [Alt, Shift, B - helps multi selection], if you make a wrong frame you can delete it here [X].
When you are pleased with your work save the project to sword_stance.blend
II. Exporting
While animation with the IK chain is much more simple and precise - you do not need to rotate all the bones of the legs one by one after each movement of the torso to keep feet in place - exporting FK animation is much more simple. In the IK chain, the position data of the controlled legs are in the helper bones. They are not used by the game, so their data lose if you export the animation to BRF. Before exporting the IK animation, you must transform it to FK.
Select Object Mode on the right. Make sure, that imported_armature - the skeleton - is selected.
Open Scripts Window on the left.
Run Scripts/Animation/Bake Constraints
Now the skeleton is FK, but not Mount&Blade compatible, so we have to export it's Action to the FK armature.
Save the project to sword_stance.blend
Open skeleton_FK.blend.
Select Append or Link [Shift F1] from File menu.
Load sword_stance.blend/Action/Action.002
Open Action Editor Window on the left.
Select imported_armature from the list of available actions.
Before export, mirror abdomen's LOC X IPO curve on the horizontal axis. Do not ask me why, but the animation will sliding in game without this process.
So, open Ipo Curve Editor Window on the left.
Select Ipo type: Pose
On the right, select abdomen bone.
Select LocX
Press A to select the whole curve.
Mirror it. [Shift M 3, or Curve/Mirror/Over Horizontal Axis]
Save the project to sword_stance_exp.blend
Time to export what we have.
Select File/Export/Brf Export (.brf)
Export Anim
Name it: sword_stance.brf
III. OpenBrf
Open sword_stance.brf with OpenBrf
Export the animation - imported_armature.
Give it the name: sword_loop01.SMD
Open uni_stances.brf with OpenBrf in Mount&Blade\Common_Res
There is already a sword_loop01, rename it to sword_loop01old
Import sword_loop01.SMD
Save uni_stances.brf
IV. module_animations.py
Edit with IDLE module_animations.py
Find sword_loop01
Change the duration to 1.0 from 9.0 (25 frames will take 1.0 sec)
Change the end frame to 24 from 200 (25. was the last key in Blender, but in Mount&Blade the first frame is 0 not 1, so 25. frame will have the number 24.
Save the changes, and run build_module.bat.
Start the game and equip a one hand weapon.
Here is what you need:
Blender2.49b: http://download.blender.org/release/Blender2.49b/
note: With higher blender versions (2.5 and above), these sripts are not working. However , you can have multiple Blender versions installed. I prefer modeling in 2.5, animating and exporting finished models in 2.49.
OpenBrf: http://www.mbrepository.com/file.php?id=1466
ModuleSystem v1.010: http://www.mbrepository.com/file.php?id=1694
BRF Export script by Dirk Schulz,
Bake Constraints script by Roger Wickes,
and skeletons (.blend) ready for animation are here:
http://web.t-online.hu/findadezso/surrealarms/mb_animacio.zip
You get two kind of skeletons. One with Forward Kinematic chain, and another with my Inverse Kinematic setup. Here is the difference:
I. Animate
We are going to set up a new sword combat stance. Open skeleton_IK.blend.
Make sure that you are in Pose Mode.
Select abdomen and the two IK_Foot bones [Shift + Right click]
Rotate them on Z axis [R + Z + (move mouse, or use Num buttones and write -75), Right Click to apply the rotation]
This will be the first frame. (1 sec=25 frame)
Rotate [R], and Move [G] bones to set up something like this.
[Alt G, Alt R] - clears the Location/Rotation.
[N] - open Transform Properties
IK controlled bones sometimes do not chose the right direction to rotate, but you can help them by rotating the thigh bones.
Press [A] to select all bones, then press (I) and select LocRot to save this pose.
Go forward in the timeline to frame 15 [Right Arrow]
Sink the abdomen on axis Z to make the crouch deeper. Rotate the legs or move the helper bones if the angles turns out.
You can also play with the upper body if you want to make the stance more flimsy.
Press [A] to select all bones, then press (I) and select LocRot to save this pose on the 15. frame.
Now go back to the first frame [Left Arrow]. Copy the pose.
Go forward to frame 25. Past the pose.
Every bone is selected, so press (I) and select LocRot to save this pose on the 25. frame.
Open the Timeline menu, set the end frame to 25, play your animation.
Go to Action Editor view. Good place to edit the lenght of the stance by moving the dots [Alt, Shift, B - helps multi selection], if you make a wrong frame you can delete it here [X].
When you are pleased with your work save the project to sword_stance.blend
II. Exporting
While animation with the IK chain is much more simple and precise - you do not need to rotate all the bones of the legs one by one after each movement of the torso to keep feet in place - exporting FK animation is much more simple. In the IK chain, the position data of the controlled legs are in the helper bones. They are not used by the game, so their data lose if you export the animation to BRF. Before exporting the IK animation, you must transform it to FK.
Select Object Mode on the right. Make sure, that imported_armature - the skeleton - is selected.
Open Scripts Window on the left.
Run Scripts/Animation/Bake Constraints
Now the skeleton is FK, but not Mount&Blade compatible, so we have to export it's Action to the FK armature.
Save the project to sword_stance.blend
Open skeleton_FK.blend.
Select Append or Link [Shift F1] from File menu.
Load sword_stance.blend/Action/Action.002
Open Action Editor Window on the left.
Select imported_armature from the list of available actions.
Before export, mirror abdomen's LOC X IPO curve on the horizontal axis. Do not ask me why, but the animation will sliding in game without this process.
So, open Ipo Curve Editor Window on the left.
Select Ipo type: Pose
On the right, select abdomen bone.
Select LocX
Press A to select the whole curve.
Mirror it. [Shift M 3, or Curve/Mirror/Over Horizontal Axis]
Save the project to sword_stance_exp.blend
Time to export what we have.
Select File/Export/Brf Export (.brf)
Export Anim
Name it: sword_stance.brf
III. OpenBrf
Open sword_stance.brf with OpenBrf
Export the animation - imported_armature.
Give it the name: sword_loop01.SMD
Open uni_stances.brf with OpenBrf in Mount&Blade\Common_Res
There is already a sword_loop01, rename it to sword_loop01old
Import sword_loop01.SMD
Save uni_stances.brf
IV. module_animations.py
Edit with IDLE module_animations.py
Find sword_loop01
Change the duration to 1.0 from 9.0 (25 frames will take 1.0 sec)
Change the end frame to 24 from 200 (25. was the last key in Blender, but in Mount&Blade the first frame is 0 not 1, so 25. frame will have the number 24.
Save the changes, and run build_module.bat.
Start the game and equip a one hand weapon.