Advanced Character Rigging - Part Three

From The DarkMod Wiki
Jump to: navigation, search

Advanced Character Rigging with Maya 7.0

Part Three

Back to Advanced character rigging Introduction

Back to Advanced Character Rigging - Part Two

After all that work of painting those skin weights (wait, you didn't rig the left arm mesh to the right upper leg joint did you?) it's time to refine our rig. So far my left upper leg mesh is rigged to LeftUpLeg, while the lower leg mesh is rigged to . . . well . . . LeftLeg:


Easy enough? But wait (weight?) . . . What happens if we rotate the lower leg back? Let's find out!

Open the Outliner & shift-click the square to the left of the origin joint:


This will expand the joint hierarchy. Now select the LeftLeg joint & rotate that joint backwards. For this example I didn't have to rotate it too far but rotate all the necessary joints at extreme angles to find your issues:


The lower leg is not behaving naturally. So how do we fix it? I'll tell you but you'd better be nice to me & send money to my PayPal account . . . oh wait, I need to update that account . . .

Here's a shot of an unusual pose thus easily spotting rigging issues (notice the stray vertex on the right leg & the torso, near the hips, has major issues):


Keep the leg in that rotation while we do a little something extra to it. This is where those handy-dandy functions like Add & Smooth come in. Select the leg mesh again then go back to the weight painter. Select the Smooth function, resize the brush so you don't accidentally paint somewhere else & select the solid round brush at the top:


Now click on the smooth function, select the LeftUpLeg joint (or whichever upper left leg joint you have), & paint the vertices below, and back of, the upper leg:


Now select the LeftLeg joint (or lower left leg joint you may have) & paint the vertices above, and back of, the lowerleg.

If you did it correctly then there'll be a big improvement when you're done:


When you're done refining your rig, select the origin bone in the Outliner, go to the menu and click - Skin > Go to Bind Pose & your original pose will spring back to where it was. It's a good idea to go to bind pose when ever you rotate joint & edit your weights.

What? I left out the Add function of the weight painter? For those stubborn rigging problems that smoothing won't work with, you use Add in small increments


I normally use weight values of 0.1000 when I'm adding weights so I don't overdo it the first time.

Other tips

  • When working with leg meshes, I flood them with the "Hips" with a weight value of one
  • When I'm working on a torso, I flood them with the "Spine"
  • You don't have to edit the md5mesh to assign shaders if your character's material names match the directory structure & texture names. For example the mercenary elite's material:

Maya's material is pointed to:


Thus the shader in the md5mesh is automatically pointed to the material name:

shader "models/md5/chars/guards/merc_elite/merc_elite_armor"

which is:

	description "armor_plate"
	bumpmap addnormals(models/md5/chars/guards/merc_elite/merc_elite_local, heightmap( models/md5/chars/guards/merc_elite/merc_elite_armor_h, 3 ) )
	diffusemap     models/md5/chars/guards/merc_elite/merc_elite_armor
	specularmap    models/md5/chars/guards/merc_elite/merc_elite_armor_s
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
        if ( parm11 > 0 )
        blend       add
        map         models/md5/chars/guards/merc_elite/merc_elite_armor
        rgb         0.15 * parm11

  • When using exportmodels in Doom3Ed, The Dark Mod is using the same animations as another character. So the rigging varies between AI & that causes a lot of problem at runtime. The export decl in the def file needs extra options:

export merc_elite {

options -scale .94
mesh merc_elitemesh.mb -dest tdm_ai_merc_elite

This tells the maya export plugin to scale the rigs a specified amount. This is really handy for different sized AI.

   addoptions -keep Hips LeftHips_Dummy blah blah2 blah3 -scale .94
   addoptions -sourcedir models/model_src/citywatch_mb -destdir models/md5/chars/guards/merc_elite

The mercenary elite uses the citywatch's animations but the rigging between the two do not match. The -keep joint option is used for these occasions. Open the md5mesh with a text editor & the af_pose.md5anim (or whichever animation you choose), exportmodels command in D3Ed, & add/subtract any joint in the def file to match joint numbers and names.

Related Articles

Back to Advanced character rigging Introduction Back to Advanced Character Rigging - Part Two