Rigging in Maya <(document.MM_swapImgData.length-1); i+=2) document.MM_swapImgData[i].src = document.MM_swapImgData[i+1]; } function MM_swapImage() { //v2.0 var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData; for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) { objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1]; if ((objStr.indexOf('document.layers[')==0 && document.layers==null) || (objStr.indexOf('document.all[') ==0 && document.all ==null)) objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length); obj = review(objStr); if (obj != null) { swapArray[j++] = obj; swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j]; obj.src = MM_swapImage.arguments[i+2]; } } document.MM_swapImgData = swapArray; //used for restore } // -->  

Using Wrap deformers, Blendshapes and SubD's to control joint deformations


I started experimenting with this in -99, when Subdivided surfaces became available in Maya.  I was looking for a better way to control those horrible joint deformations, without resorting to weight-painting, or dozens of high-res copies of the whole model for Blendshapes.  I was also not happy about how 'un-smooth' the result was, when Smooth-Binding a high-res model straight to a skeleton. 

At first I saw the Wrap deformers as possible stand-ins for muscle and bone, and modeled them quite anatomically correct... but I soon realized this deformer's influence zone is too 'blurry' when set high enough to catch all geometry around it, to be useful this way.   So I gradually modeled the Wraps closer and closer in shape to the geometry they were deforming.  Until in the end, I simply copied the 0 level of it, and set the influence zone down as low as I dared; this seems to give the best control.  But it also means you have to make sure not to move any of the 0-level verts relative to its Wrapper double, because the first may easily end up outside of the influence of the second (which ruins the whole effect).

First sketch what you're going to model, and decide as much as you can about the topology.  In this method everything depends on a good topology in the 0 level mesh.

    Keep in mind:
    *  As low-res as possible, while still delineating the folds and major planes, and keeping enough divisions around joints.
    *  Triangles - not at all as bad as they say, least not in Maya.  But keep them out of areas that deform a lot, and/or need to be smooth.
    *  Polys should always be as square as possible.  Long thin polys are ONLY ok if they go in the direction of a fold or wrinkle.
    *  And most important - the direction of the edges must NEVER run at an oblique angle to either a form in the neutral un-deformed surface, or in the deformed one, or you'll be hurting later.  Sometimes, like on the palm of the hand, the surface has 2 opposing sets of wrinkles depending on which way it bends, in this case try to catch both directions with your topology; if you can't get both, pick the most important one.

    Model the surface according to your sketch and reference.  You could start with a box, or a NURBS surface, it doesn't really matter, as long as you end up with a polygonal surface looking like your sketch. Use whatever poly-tools you're comfortable with. Also, o improve modeling you need to look at the real thing, I've found the best references here.

     

     


In this case I used a poly cylinder 8x17 (in fact 18 which I later found was one too many).  Delete the top and bottom caps, Scale and Translate verts, first in the side view then front...
When you're done, if the edges don't run the way you need them to, use the Split Tool to create new edges, then delete the old edges. (Then delete any orphaned vertices, you don't need to be careful picking them, since only the orphaned ones can be deleted).  Alternatively use "Delete Edge" from the "Edit Polygons" menu, this will automatically get rid of orphaned verts.
Since this topology is very important to the final result, you should take your time to fix things, don't rush on to the next stage.  Also, you could theoretically use it as a basis for many other models.

IMPORTANT!  NOW is the time to create your UV mapping.

When you're totally satisfied with the topology and UV's, convert to SubD one last time and start editing on the higher levels.  Remember: keep the hierarchy (not the same as the history).
You may have to go through a few false starts (God knows I have), since some problems don't become apparent until you start modeling on a higher level, or even until you start creating morf targets.  Whenever you start over, you loose any work on the higher levels. That's why I spend so much time to get the 0 level just right; if you follow this tutorial you should save some time.

General advice for hierarchical SubD's: 
Look for BlindData nodes in the Hypergraph (Upstream/Downstream), delete them. 
Go back into Poly mode occasionally, then right back to Standard - it cleans up possible cracks both in the model and UV's. 

To fix bad UV's on a hierarchical Subd, without loosing all your edits:
copy Subd model A to low-res poly model B (using the 0 level). Fix the UV's on B. Then turn B back to a Subd C, then use C as a base shape and A as a target shape and do a Blendshape - pulling the slider up to max should bring back the edits on C, and still have the good UV's. Then all you need to do is make a copy D of C, to freeze the deformations, and you're set.

When going back to an area for editing at a later date, try to find the lowest level that'll work.  Otherwise you waste effort, and risk making the surface overly bumpy (since each higher level has 4 times the points than the one beneath). Such bumps are hard to get rid of, without deleting ALL the edits you've ever made on that level. You will also be confusing the issue for any later edits you may have to make there. 

Let's continue - this is where it gets easier.  You can finish modeling and fine tuning your SubD later (as long as you don't touch any verts on level 0), because you can detach and re-attach it to the skeleton with a few mouse-strokes at any time.


Copy the SubD surface, and convert the copy (on the 0 level) back to a polygon.  Name it 'Wrapper', name the SubD 'Skin'.  Make a few more copies of Wrapper, move them aside.  Create 3 layers, one for Skin, one for Wrapper, one for Morftargets.  Name the targets appropriately, for instance in this case: KneeLeft1 and 2.  Create a Blendshape, call it Bodytargets.

 

 

 

 

 

 

 

 

 

 

Smooth-Bind Wrapper to your skeleton (if you do this before the Blendshapes you'll have to rearrange the stack of deformations).
Set a keyframe on frame 0 for all the joints, then set keyframes on later frames with different joint rotations; for instance, I made this knee rotate to 90 degrees in Y on frame 1.  That way I can quickly and easily jump between several exact values of rotation, even while hiding the skeleton - a great help later when doing the Set Driven Keys.

 

 

 

 

 

 

 

 

 

Create the Wrap, Skin is white, Wrapper is green, Max Distance as small as you can make it - Apply. 

If you ever have to detach, pick the Skin, go into the Hypergraph, press F, press Downstream Connections and find wrap1 and wrap1Set and delete these.  You also get invisible Base shapes left behind that you may have to find in the Outliner and delete.

 

 

 

 

 

 

 

Now when I go to frame 1 the deformations look like in the first example below, pretty damn crappy if I do say so myself...  but still better than if you used a collapsed SubD or high res poly mesh bound directly to the skeleton.

 

Pull the slider for KneeLeft1 up to 1 and start re-shaping the target.  Keep it visible in the orthogonal views, wireframe, keep the Skin in the perspective view, smooth shaded.
Basically the front verts go forward, the lower front ones go up and the upper go down, the back verts go back a bit... you'll see, it's easy.  I did these adjustment in less than 5 minutes. 

 

 

 

Now the morf target looks like this:

You'll want to add more than one target to each knee.  Now do the next target, maybe at around 130 degrees.  

This one is trickier to get right - now the verts on the Wrapper geometry's thigh and calf are penetrating each other.  And since Wrap deforming isn't based on a "one-on-one relationship between 2 verts" but more of a "whichever is closest will have the most effect", it gets harder to control their behavior as they clump together.

 

 

Next use Set Driven Key to hook these Blendshape sliders up to the Y-rotation of that knee.  As the first slider reaches 1, the other stays at 0.  As the second reaches 1 the first stays at 1, and if you have other targets, so on. 

The hip usually needs 2 targets forward, and the spine maybe about 10 (left/right, back/front, lower/upper spine).  The neck needs a few, and the shoulder needs about 4.  All in all you should be able to make do with about 20 - 30, which is still very light and doesn't take that long to do. 

If you want the knee to be even better than this you can either raise the resolution of the Wrapper - though there's a limit to how useful that can be, due to the 'fuzziness' of the influence area I mentioned earlier.  You can also add Blendshapes straight to the high-res Skin, though I'd save that as a last resort - one such target makes the file much heavier than Wrapper targets.  (Most of the other joints won't need this though.) Here's what the 90 and 130 degree rotations can look like with such fine-tuning:

 

 

 

 

 

 

Added benefits of this system: you can quickly, easily, and with little extra file-size, create targets to handle big sweeping changes to the geometry, which are typically very hard to do on very high-res geometry.  You can then easily animate these changes.  For instance, the character can very easily be made fatter or skinnier, or pregnant, or suddenly get Popeye arms etc.  And you can do these things much later, it's very flexible and modular that way.

Also, if you hide the Skin the file is very fast and interactive and easy to animate - a built in low-res proxy.

Here's a screencap showing 3 different bodies, 2 descendants created from the original.  Since they all have exactly the same topology on the 0 level, they can all be animated using the same Wrap deformer, which means there is no rigging time at all needed to switch between these 3, simply un-Wrap and re-Wrap. 

The middle one is cut in 2 pieces, the seam is covered by a belt.  The neck seams are covered by necklaces or collars. 

 

 

 

 

 

Since Subd's are tricky to work with, why not use poly meshes instead?
Here's the same Skin, after doing Adaptive convert to poly, using the same Wrapper, (no morftargets yet).

I had to set the threshold on the Wrapper up higher to catch all the verts, which lessens the control you have.

It's quite jagged, and applying a morftarget to this will be messier, take longer, and up to 30 of them will be quite a heavy file in the end. And if I ever wanted to make major changes to the body, I would most likely have to redo all those 30 targets.  The results would be even worse in areas like the butt and shoulders.

 

 

This shows how I lay out my Blendshapes - I overlap the ones that go together as a left-right pair, and place all for the same joint in the same row.  In this example I'm using 3 consecutive targets for the knees.

 

 

 

 

 

 

 

 

 

Here are the hip targets. 

The rest of the targets for this particular model (so far) is:

Breathing
Stomach Breathing
Spine Forward (lumbar region)  the other spinal directions look ok with default Smooth-bind
ShoulderDown, left/right
ShoulderUp 1, left/right
ShoulderUp 2, left/right
ShoulderForward, left/right
ShoulderBack, left/right
InnerShoulderForward left/right (extra joint above Shoulder)
Elbows 1, left/right
Elbows 2, left/right
Wrist-roll, left/right
Arm-roll, left and right (actually shoulder-roll, but using extra joint in upper arm)

33 in all.  (To control the neck I use a couple clusters.)
 

 

 

 

Best site for human reference photos: 
http://www.3d.sk

 

Copyright 2001, 2002 Steven Stahlberg