B Tutorial Animation Extension Tutorial - Rigging And Animation.

Users who are viewing this thread

Yoshiboy

Count
Extension tutorial – Rigging

Chapter one – What is rigging? And why does it have to be done.

When you animate something in a game you use these things called “bones”. They are quite similar to their human counterpart in that you move the bones as part of the animation and then the rest of the mesh follows. These bones are used because it makes animation much, much easier than if you were to just move every vertex of face individually.

There is only one downside to the use of bones in animation. It means that anything that is animated has to be “rigged” to the skeleton (collection of bones) so that the computer knows how the model reacts when the bones move.

The process of Rigging is in theory very simple. You tell the computer how much each vertex is affected by each bone in the model when the bone moves. When the vertexes are attached they will move with the bones allowing the model to be positioned and animated simply by moving a handful of bones.

In mount and blade there are only two types of models that are animated: Humans and horses. This means that overall the amount of rigging we have to do for mount and blade is very little. We only need to rig body armour and any new horses that we make.

For this tutorial I will be using 3d studio max 7 although it can be applied both to any version of 3d studio max or to Gmax.

3d Studio max is extremely expensive, but you can download the free trail from their website:

Click here and look for the button on the right that says about a 30 day free trail.

Alternately you can download Gmax, which is very similar to 3d studio max but without as many tools.

download it here.

Now, normally in mount and blade we would be importing and exporting .obj files when we are making meshes but because .obj files don’t support vertex weighting (or rigging to you and me) we have to use a new file type. Don’t get too hung up about this, it’s still very simple. All it means is that we have to download the appropriate plug-ins for Gmax or 3d studio max. Here is a list of all the tools you will need. Obviously you only need the ones for your chosen program.

SMD plugins for max

SMD importer for max/gmax

SMD exporter – gmax



So, once you have your program and your appropriate tools – we can get going.

Chapter 2 – preparing a model.


Before we get rigging, we need to export one of M&B’s skeletons to work from. This is easy enough. Simply open up thorgrim’s BRFedit (found here) and open up a BRF with a horse or armor in (whichever you want to make). Once you have done this simply click on the model to export and press “export” near the top. Find an appropriate save location and save it there. When it asks you for the skeleton type pick the one that fits. Usually this will be already picked for you.

So, we have our SMD file exported and ready. Now all we have to do is import it into max – so open up Gmax or max or whatever you are using. If you are using Gmax you better read Thorgrim’s tutorial on how to use the scripts. That can be found here. If you are using the HL2 SMD plugins for 3dsmax it is very simple. Just go “File > Import…” then select .SMD from the file type to open and browse to your SMD you just exported. The scene should look something like this.

scene.jpg


You should have a selection of bones there with the mesh you exported on top of it. Your next step is to delete the existing mesh and import your new armor that you want to rig. Once you have imported your new armor and lined it up over the bones so that it fits nicely you can get about to rigging it!

First of all select the mesh and go click the little icon called “modify” on the right hand side bar. Its picture is something like a quarter of a grey tire or something. Once this is pressed you will want to click on the drop down menu called “Modifier list” and select from this the modifier called “Skin”. To get to this quickly you can keep pressing “S” until you get there.

This is your rigging modifier. The term “Skinning” is also a term used for rigging a model, I prefer to use the term rigging because “Skinning” is also commonly used meaning the same as “Texturing”.

Before you want to do anything you want to tell max which bones you want to rig the model to. To do this press the “Add” button on the right menu and then “All” in the new box that appears. This will select all the other objects in the scene to use as bones. This should be fine as long as you don’t have any other objects in the scene, if so just deselect them by holding ctrl and clicking on their names. Once you have all your bones selected press the “Select button” and it will add them to the modifier.

scene2.jpg


Now you have your bones ready there are two ways of rigging your model, either you can use “envelopes” or you can simply assign weights manually to each bone. Assigning them manually is probably the easier option to pick up and understand but using envelopes is by far quicker and most efficient. They are my favourite.

Chapter 3 – Rigging.

Using envelopes

There is an envelope for each bone on your model. An envelope is like a volume assigned to a bone, any verts within the volume of the envelope will be given a weight assignment depending on how near it is to the bone. An envelope is made up of two parts. The wide affect area and the close affect area. The wider area affects the verts within it, but the close area affects then with a much higher priority.

To start adjusting your envelopes press down the “edit envelopes” button and make sure the “envelopes” and “cross sections” buttons are ticked. Once this is done select the bone which you want to edit the envelope of and find the little tabs on the end of the envelope (highlighted in green below) which you want to adjust and pull them around to make it cover the area you would like.

scene3.jpg


scene4.jpg


As you can see in this image the model changes colour depending on how much the verts are rigged to a bone. A vert which is 100% rigged to the current bone will turn Red. One that is around 50% should be orange, 25% should be a yellow and any less will be a shade of blue. This will make sure that you get a nice balance when the join moves and stops stretching.

Adjust the envelopes for half the bone in the model as well as all the center bones. Max has a feature to mirror the rigging from one side of the model to the other so we will use that. That will be covered later.

Rigging by verts

Rigging by verts has a slightly different setup to the envelopes. First, at the top of the modifier options you need to tell it you are rigging by verts instead. To do this, tick the boxes as follows:

scene5.jpg


there are also some display options I like to use to make rigging via verts more easy. So scroll down the modifier to where you have the display options and change them to the following:

scene6.jpg


Now, rigging by verts is very simple. Select the bone which you want to rig the selected verts to, select the verts to rig and then adjust the amount in the box called “Abs. Effect”. (remember that to add to a selection hold ctrl and to subtract from one hold shift) This is the amount the verts are affected by that bone; it is colour coded the same as if you were using envelopes. (A vert which is 100% rigged to the current bone will turn Red. One that is around 50% should be orange, 25% should be a yellow and any less will be a shade of blue.) You very simply repeat this process of setting that verts for half the bones on the model and then you can use the mirror mode to reflect this over.

Chapter 4 – Extras.

Using the Mirror Tool

First of all scroll the modifier to where you can see the options for the mirror tool and select the button that says “mirror mode”. This will colour half of the verts/bones on the model blue and the other half green. This is as long as you have the mirror plane in the right place. By default it should be over the X axis, which is correct. If not you can change it to go over the Y axis. If it is on the wrong axis most of the verts will be coloured red.

scene7.jpg


Anyway, mirroring the assignment is as simple as the click of a button. If you have rigged by envelopes you will want to press the relevant “paste bones” button. Pasting the colour you have rigged to the side with the colour you haven’t. If you rigged by assigning verts you will want to do the same but use the “paste verts” buttons instead. Once this is done turn mirror mode off again by clicking the “mirror mode” button and select your bones that were on the un-rigged side to see if it worked.

Checking all verts are rigged

If you haven’t assigned all the verts to a bone with a model then you will probably get some nasty effects once you import into M&B. Verts which are un-rigged will appear at the origin on a model, meaning they will be stretched all the way to the bottom of a person’s feet, or between a horses.

Making sure all the verts are assigned to a bone in max is relatively easy. Simply select all the bone objects without the main mesh and move it all up or along, it will become pretty clear which verts are not rigged, as they will not move with the rest of the model.

(An easy way to select all the bones is to drag a box over the whole scene then hold ctrl and de-select the main mesh.)

Exporting

Exporting is done largely in the same way importing is. If you are using the max tools then simply select the mesh and export as a .SMD file. When you are given the option of how to export always select “reference” instead of skeletal animation.

If you are using Gmax then follow thorgrim’s tutorial found here.


Importing into BRFedit

This is just the same as you would any other mesh. Go “file > import” and on the option box that it gives you just use whatever the default option is.

A few notes

When you are rigging a humanoid model the hardest part to rig will be the shoulders. Usually it is best to give them a very small but strong area of affect. These bones will stay horizontal when the rest of the arm moves down, they keep the side of the model steady when the arms flail about. It is best to keep the arm bones from having too much of an influence on the shoulder area verts.

When you are rigging armor and you have parts of the armor that you don't want to bend, like a shoulder pad - what you want to do is rig it all with 100% to one bone, usually doing it via vertex rigging. This will mean that it wont bend and look funny when you put it in game and it starts to move.

Sometimes you can really mess up your rig, and you might well do that the first time you try. Don’t worry, with practice you will get better and spend less time on it as well.

If you have any more questions or any parts of rigging you think need covered or any problems with the tutorial please post them here.

Yoshiboy.
 
Cool tutorial, Yoshiboy. I knew a bit about rigging but this will sure help a lot with the stuff I didn't...

One question: Most of the plate armor in the game have wide chain mail joints, so when the bones bend the armor skin it won't look funny.
I have noticed, though, that some armors have hard, non-bending parts. For example the shoulder protection on the Dark Knight armor.
Do you have any idea how that is achieved? Using mild rigging with yellow/blue shades of the envelope thing you've shown?

Thanks a lot for this tutorial. You're the man. I mean, boy... er... dinosaur?  :mrgreen:

Ragards,
-Stefano
 
And that would only be achieved through the "Rigging by verts" method, as the envelopes are linked to the bone "area of influence", right??
 
Nice work, well this covers 1/2 of what I was including in my animation tutorial (that I was trying to get done last week)  So I'll try and finish off the animation half I guess, unless you plan to do that too? :smile:
 
Okay, when I import the .smd that I want to rig, it doesn't show up. It probably has to do with the fact that BRFedit will crash when I export my mesh because it doesn't have a skeleton.

So...??
 
Good thread Yoshi, never saw it before. I had a unique method of learning how to rig, it's called ***** at RR_Raptor until he teaches you  :grin:
 
Dwinny said:
Okay, when I import the .smd that I want to rig, it doesn't show up. It probably has to do with the fact that BRFedit will crash when I export my mesh because it doesn't have a skeleton.

So...??

bump?
 
Dwinny said:
Dwinny said:
Okay, when I import the .smd that I want to rig, it doesn't show up. It probably has to do with the fact that BRFedit will crash when I export my mesh because it doesn't have a skeleton.

So...??

bump?

Don't know, why does BRFedit crash on export? Just export any armor or horse mesh in .smd format and it should work ok.
 
It crashes, and the file it exports is an empty file. The only thing I can think of is that it asks me what type of skeleton it is when the mesh doesn't have a skeleton at all.
 
Nope, it still crashes when I export. Seems to crash whenever I try to export a model that doesn't have a skeleton into an .smd.
 
Dwinny said:
Nope, it still crashes when I export. Seems to crash whenever I try to export a model that doesn't have a skeleton into an .smd.

I don't quite understand, what mesh are you exporting from BRFedit?
 
Any mesh. It seems that any mesh without a skeleton will crash the program and fail to export. Anyway, I'm using gmax to import the objs and export smds now, but for some reason, either gmax exporting the smd or brfedit importing it wll screw up the scale and/or origin of the model.
 
Dwinny said:
Any mesh. It seems that any mesh without a skeleton will crash the program and fail to export. Anyway, I'm using gmax to import the objs and export smds now, but for some reason, either gmax exporting the smd or brfedit importing it wll screw up the scale and/or origin of the model.

Why are you exporting non-animated meshes as .smd anyway? You should be exporting only animated meshes as .smd and non animated meshes as .obj Tell me exactly the process you doing and what meshes exactly. I still don't understand what you are doing, sorry. Also check the brfedit importing options from .smd there are various ones there to do with scale etc.
 
You know, I don't even remember why I was exporting .smds. Anyways, that's not a problem anymore. Thanks for trying to help anyway.
 
Back
Top Bottom