r9 - 30 Sep 2011 - 12:57:20 - MattBernadatYou are here: TWiki >  Maya Web > MayaToHoudini > MayaPlugins > MayaRender > MayaRenderMan > MayaRigging

Rigging

Shape to Bones

You can add shapes to a given transform node. This allows for complex, non-attached nurbs controllers. The trick is to parent a shape to a transform using the -shape flag:

parent -shape -relative

Make sure to select the shape of the first object (select object, hit the down arrow) then the transform of the second object (select the parent). Run 'parent -s -r'.

onesingleobject.gif

If you don't use the -r flag, you'll get transform nodes inside transform nodes (see below), and selection won't work. If you don't use -r, make sure the two objects have the same transforms first.

-- MattBernadat - 16 Feb 2010

Unparenting joints keeps making transform groups

Happens if you have 'interesting' heirachies or previously keyframed values. Hit shift-P to unparent joints to the world, and you'll get it parented under an annoying 'transformN' group. The trick is to use edit->ungroup instead. (If you're doing this on the resultant transformN node, select it rather than the joints beneath it).

Change or reset joint colors

If maya's generally useless joint/wireframe colours cause grief, use the command

color

to get it back to normal. If you want to change colors manually, its under display->wireframe colors, or use

color -ud [1-8]

Lock Set Driven Keys

Its easy to knock sdk's in the graph editor, especially if you quickly run a 'select hierachy'. This script finds all sdk's attached to the current selection, and locks the animcurve keytime values. The sdk's still show up in the graph editor, but they won't move.

meLockSDK 1; // locks sdk's

meLockSDK 0; // unlocks sdk's

Dual Quaternion Skinning

Interesting... open source plugin thats an alternative to soft-skinning, looks like it does a much better job of preserving volume.. haven't tried it yet...

http://mayadqskinning.sourceforge.net/

Blendshape Combination System (BCS) by Daniel Pook-Kolb

Been keeping a weather eye on this for a very long time. Mr Pook-Kolb has been working on a blendshape plugin that allows for corrective face shapes. As any weta fanboy knows, the gollum rig was based on such a system, but from what I understand needed a massive nest of utility nodes under the hood, whereas BCS is just the one. Daniel is clearly some sort of ubermensch when it comes to the code, but each time I tried to read the documentation my head hurt, and gave up. But then he made these 2 videos:

That clinched it for me. Took a deep breath, downloaded the plugin, and read the tutorial. Its actually not as complicated as I thought. In fact, I reckon 90% of the functionality is hidden behind 5 clicks. The rest of the interface either handles advanced functions you'd rarely need, or ultra handy convenience functions that make you think 'damn, wish I'd known about that earlier' (kinda like maya itself really). The typical workflow goes like this:

  • made a jawOpen blendshape (BCS calls these dataPoints, don't get confused)
  • make a smile blendshape
  • set both jawOpen and smile to 100%, decide it needs fixing
  • right click both names in the BCS interface, choose 'create new data-point', and you get a new jawOpen+smile shape.
  • sculpt this as you please
  • that jawOpen-smile blendshape gets correctly interpolated when jawOpen and smile are at 100%. No set driven keys, expressions, fancy nodes, or anything else. In fact, even the jawOpen+smile shape is hidden away inside the BCS GUI, to be seen only when you choose to explicity edit it. The only sliders you see when animating are the master shapes (jawOpen and smile). Very neat.

What I found even more impressive is the speed; BCS felt just as fast as a regular blendshape node. And the convenience functions I mentioned earlier are fantastic. Shape flipping/mirroring, auto splitting of shapes into left-right pairs (with full control over the amount of falloff), a blendshape painting tool built-in, and other misc stuff. In terms of blendshape control, the workflow above is the basic level you get. Beyond that you can add mid-shape shapes (to get proper arcs on the jaw for example), control over vertex interpolation (linear, spline, arc etc), mid-shape corrections, and other stuff that gets ultra ultra deep.

Anyway, if you looked at BCS but got scared by the docs, give it a shot. Its well worth the effort. I read about it too late to include in our Jackanory pipeline, but we're now making it the base for 'Swivel Head Ted'.

The Setup Machine 2

If you're like me, and you appreciate all the hard work that goes into making a good rig, but can't be arsed to do it yourself, get anzovin.com's setup machine. Its a steal at $99, and covers 95% of your rigging needs. Better yet, Morgan and Raf (the duo behind the system) are incredibly helpful and quick with updates. Buy TSM2 and support the team, they're doing great work.

Cartoon Eyes

Duncan via highend3d:

I created an expression that put the angle of the camera with a characters head into a dynamic attribute. I then used that dynamic attribute with setDrivenKey on the position of the eyes, so they would slide around to the best position to face the current view. This is an iteresting technique for toony characters, as one can smoothly transition between different shapes for your model based on the view rather than keeping things rigidly 3D. (traditional cel animation usually deforms faces to have the best expression for the current viewpoint) With the set driven key you can simply change the viewpoint, adjust your model, then set a driven key for that point of view.

Here is the expression I used to stuff the view/head angle into the dynamic attribute "headViewAngle". It ended up being a bit tedious, involving 3 added locator nodes. The two locators on the head define a direction and a third is grouped under the camera and positioned in front. Also I needed to add a dummy attribute for updating... this is because one needs to use setAttr on headViewAngle instead of directly setting it. Better than all this would be a simple custom dependancy node that one groups under the head. I'm sure there is a simpler way of scripting this.

vector $p1 = <<locatorShape1.worldPosition[0].worldPositionX,
      locatorShape1.worldPosition[0].worldPositionY,
      locatorShape1.worldPosition[0].worldPositionZ>>;
vector $p2 = <<locatorShape2.worldPosition[0].worldPositionX,
      locatorShape2.worldPosition[0].worldPositionY,
      locatorShape2.worldPosition[0].worldPositionZ>>;
vector $p3 = <<persp.translateX,
      persp.translateY,
      persp.translateZ>>;
vector $p4 = <<locatorShape3.worldPosition[0].worldPositionX,
      locatorShape3.worldPosition[0].worldPositionY,
      locatorShape3.worldPosition[0].worldPositionZ>>;

vector $d1 = $p1 - $p2; // direction of head towards ear
vector $d2 = $p2 - $p3; // camera direction
setAttr carrotTopControl.headViewAngle (angle( $d1, $d2 )/3.14);
carrotTopControl.dummy = 1; // dummy for updates

Corrective blendshapes without PSDs

Ideally you should use pose space deformers, but if you can't, here's a neat trick by Jeff Unay (originally from here, but the site appears to be down). To state the problem yet again, you have a bound mesh, rotate the elbow, and you want to fix it with a blendshape. If you try and move the mesh in place the verticies go all wacky, but if you try and work with a copy of the mesh in the bind pose, its awkward to work with. Here's a way around:

  • rotate the elbow joint until it looks bad
  • duplicate the mesh, call it A
  • duplicate again, call it B
  • sculpt B until it looks right
  • setup a blendshape on your skinned mesh to both A and B, with mode set to parallel
  • set blendshape B to 1, A to -1. This will subtract the transform weirdness, so you can now rotate your joint to 0, duplicate that shape, delete A and B, and you have your corrective shape made.

I have to note that this technique can`t be used for correcting animated 3d character in production. Once you start to rotate parent joints above the bended joint, the correction effect distorts the shape. However PSDs for Maya like bodyBlend.mel or Michael Comet`s poseDeformer are there available. JakubKrompolc - 05 Feb 2006

I tried doing it with maya2011, since I think blendshapes have changed, and it works if I do corrections on a single joint each time (the rest of the mesh should be neutral), do the abovementioned trick, extract the shape during the last step, do it over for all the corrections, take all the shapes, put them in a parallel blender and then do the SDKs. I try to steer clear of the parallel blender JMattBernadat- 30 Sep 2011

Surface, CV, and Curve constraints

Maya doesn't have specific constraints designed for locking an object to a location on a surface, or a cv, or a curve. That is to say you can't go to the constraints menu and find a constraint for those situations. Sure there's a geometry constraint, but that allows the constrained object to wander around on the surface of an object. What if you want the object locked, and not wandering freely, or at least wandering controllably. There are a few options and all differ depending on the type of geometry you're constraining to.

NURBS surface

There is a node called pointOnSurfaceInfo that can give you all the geometric information about a particular uv param point on a nurbs surface, such as position in world space, normal vector, tangent U/V vectors, and normalized normal and U/V vectors. Running the command createNode pointOnSurfaceInfo will create the node for manual connecting. Here's a snipet of code that can quickly create a locator constrained to a nurbs surface. I also threw in a normal constraint so the locator will always be oriented aligned with the normal (you can do this manually with the info that you get from the pointOnSurfaceInfo, but the normalConstraint already does it):

string $nurbs[] = `ls -sl`;
string $pos = `createNode pointOnSurfaceInfo`;
setAttr ($pos+".turnOnPercentage") 1;
string $loc[] = `spaceLocator`;
addAttr -ln parameterU -at double  -min 0 -max 1 -dv 0.75 $loc[0];
setAttr -e -keyable true ($loc[0]+".parameterU");
addAttr -ln parameterV -at double  -min 0 -max 1 -dv 0.75 $loc[0];
setAttr -e -keyable true ($loc[0]+".parameterV");

connectAttr -f ($nurbs[0]+".worldSpace") ($pos+".inputSurface");
connectAttr -f ($pos+".position") ($loc[0]+".translate");
connectAttr -f ($loc[0]+".parameterU") ($pos+".parameterU");
connectAttr -f ($loc[0]+".parameterV") ($pos+".parameterV");

normalConstraint -weight 1 -aimVector 1 0 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0 $nurbs[0] $loc[0];
When using the above script, select a nurbs object and run the script. There will be a Parameter U and Parameter V attribute on the locator, if you slide these values you can see the locator change position along the NURBS surface. Useful smile Notice that the nurbsSurface.worldSpace attribute needs to connect to pointOnSurfaceInfo.input, this is often confused by people who have never used this node before.

NURBS CV

Every once in a while you need to constrain an object to a nurbs CV instead of a nurbs surface. This can be done using another node called, more simply, surfaceInfo. It will give you information on CV & Knot postion in world space, and CV weight values (for hard cv's, in case you needed that information). Running the command createNode surfaceInfo will create the node for manual connecting. Now, unfortunately when referring to the CV's of the NURBS surface, this node organizes all U and V CV's in a single CV array attribute. This is unfortunate because you can't simply tell the node "give me nurbSurface.cv[0][12]." You have say "give me cvIndex[324]." This index is U dominant and also dependant on number of spans and surface degree. Bah! Well, enough complaning, this formula is how you can calculate the Udominant cvIndex:

index = (cvNumU * (degreeV + spansV)) + cvNumV
WHAAAA? Yeah that's what I said the first time I looked at this. Alas, looking deeper its not terribly complicated.

example: I want to find the Udominant index of a cv of a standard nurbs sphere primitive nurbsSphere1.cv[3][3]. Here's the important info about the surface:

  • cv: nurbsSphere1.cv[3][3]
  • cvNumU = 3
  • cvNumV = 3
  • degreeV = 3
  • spansV = 8
index = (cvNumU * (degreeV + spansV)) + cvNumV
index = (3 * (3 + 8)) + 3
index = 36
So in surfaceInfo speek, we want the position of the 36th cv. BTW, if you make a script to do the above its much easier. The following snipet of code will constrain a locator to the 36th CV on a nurbs surface:

// locator on nurbs cv
string $nurbs[] = `ls -sl`;
string $si = `createNode surfaceInfo`;
string $loc[] = `spaceLocator`;
connectAttr -f ($nurbs[0]+".worldSpace") ($si+".inputSurface");
connectAttr -f ($si+".controlPoints[36]") ($loc[0]+".translate");
You can also throw a normal constraint on this bad boy, if you need the orientation from the surface at that CV.

NURBS Curve

There are a couple of ways to constrain an object to a curve using various hidden nodes in maya such as pointOnCurveInfo and curveInfo. Much like their surface counterparts they supply information about the curve at a particular point along the curve. I will discuss these (they work almost exactly like the pointOnSurfaceInfo and surfaceInfo), but before I do I'll describe the easiest way, most straight foreward way...plus its in a menu item.

Attach to Motion Path!!!! Yes its used for animation objects along a curve, and if it can move an object along a curve, doesn't it seem logical that it could pin an object to an arbitrary position along that curve. Heck yes! Do it like this:

  1. Select your curve first and your constraining object (a locator maybe) second
  2. Run Animate -> Motion Paths -> Attach to Motion Path [] (options box)
  3. Set the following options:
    • Time Range: Start
    • Follow: On if you want the objects orientation to point along the normal, and U direction of the curve, Off if you have no need for curve orientation.
  4. Hit Attach. In the Channel Box under inputs you should see a node entry called motionPath1. Click the text to expand the attributes (or go to the attribute editor)
  5. Delete the animation on uValue and adjust its value to slide your object along the curve.

Wasn't that easy? Now, in case having a motion path is combersome for your setup, or you just don't like it (sometimes it throws cycle check errors) there are alternative approaches. But remember, the motionPath node can calculate all the orientation information you need. You can also give it an upVector Object which determines the upVector of the constrained object by pointing it at another object. This can aleviate that annoying flipping problem that can happen with curves that have very sharp turns in them.

The Node-based Approach

Technically the motion path is node based approach too, but this is more rudementary and is exactly how the NURBS stuff up top works. The nifty curve counterpart to pointOnSurfaceInfo is called pointOnCurveInfo which, given a parameter location (sample on a curve) it will spit out useful stuff like world space position, curve normal & tangent vectors, and even the radius of curvature. Additionally, much like adding a normal constraint to get the surface orientation, with a curve you add a Tangent Constraint which will align the geometry along the tangent/normal of the curve. elow is a snipet of script that will accomplish this constraint:

string $curve[] = `ls -sl`;
string $pos = `createNode pointOnCurveInfo`;
string $loc[] = `spaceLocator`;
addAttr -ln parameter -at double  -min 0 -max 1 -dv 0.25 $loc[0];
setAttr -e -keyable true ($loc[0]+".parameter");

connectAttr -f ($curve[0]+".worldSpace") ($pos+".inputSurface");
connectAttr -f ($pos+".position") ($loc[0]+".translate");
connectAttr -f ($loc[0]+".parameter") ($pos+".parameter");

tangentConstraint -weight 1 -aimVector 1 0 0 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0 $curve[0] $loc[0];
If you compare this code snippet to the nurbs code snippet they are almost exactly the same, except there are fewer attributes to connect as well as the different constraint type for orientation.

NURBS Curve CV

Constraining to a NURBS Curve CV is about the same as a NURBS Surface CV. Instead you use the curveInfo node. The cool thing about it is constraining to a curve CV is easier than constraining to a surface CV because there are no V cvs, only Ucvs. Remember how we had to find a Udominant cv index for the surfaceInfo node? That isn't necessary and you can feed the cv number verbatim into the connectAttr command. In layman speak, if you are constraining to nurbsCurve1.cv[6] then you connectAttr to curveInfo1.controlPoints[6]. That's nice...Here's the snippet:

string $curve[] = `ls -sl`;
string $ci = `createNode curveInfo`;
string $loc[] = `spaceLocator`;
connectAttr -f ($curve[0]+".worldSpace") ($ci+".inputSurface");
connectAttr -f ($ci+".controlPoints[6]") ($loc[0]+".translate");

Remember, if you want the curve's orientation while constraining to a CV, use a tangent constraint.

Polygon Surface

Ok, so here's where we have to get really creative. Alias, in their infinite knowledge has not yet directly released a supported set of polygon or subdivison nodes that will allow you to query surface information. They have included these nodes as examples in the API Devkit, however. So if you get access to that, then you can use these plugins. There are some other ways but they aren't perfect, and for some people, a couple of the options are not available. Lets go through them from easiest and most reliable to wtf just work!!

Using Maya Hair

If you have Maya Unlimited constraining an object to a polygonal surface is actually a pretty simple task thanks to the hair module. The hair module creates follicle nodes which follow the surface of a NURBS or polygon object and they determine where a hair curve base is. The great thing is they follow a NURBS or Polygon surface, which is what we need. Here are two easy ways to create this follicle on a polygon surface:

  1. Select a face on your polygon object
  2. Go to Hair -> Create Hair [] (options box)
  3. Set the following options:
    • Output: NURBS Curve
    • At Selected Points/Faces
  4. Click apply and the new follicle will lie in the center of the polygonal face
  5. Delete the curves and hairSystem1 node that accompany the follicle and you'll be left with an object that is constrained to the surface of a polygon

The above method has you manually cleaning up hair system nodes and curves you'll never use. Here's a different way through mel script so you don't have to do any manual work:

string $poly[] = `ls -sl -dag -type mesh`;
string $fol = `createNode follicle`;
string $folTrans[] = `listRelatives -parent $fol`;
connectAttr -f ($poly[0]+".worldMatrix") ($fol+".inputWorldMatrix");
connectAttr -f ($poly[0]+".outMesh") ($fol + ".inputMesh");
connectAttr -f ($fol+".outTranslate") ($folTrans[0] + ".translate");
connectAttr -f ($fol+".outRotate") ($folTrans[0] + ".rotate");
setAttr ($fol+".parameterU") 0.75;
setAttr ($fol+".parameterV") 0.75;
The follicle outputs the translation and rotation, so it automatically does oriention for you too. You can change parameterU and parameterV to slide the follicle over the surface. This is probably the best and most headache-free way to constrain an object to the surface (or vertex) of a polygonal mesh. CAVEATE: hair is not supported on subdivision surface geometry = lame

One alternative to not being able to use hair on subd geometry is to convert it to poly proxy mode and apply the hair follicle to the poly proxy cage. It will not lie directly on the surface but will at least follow an approximate surface that you can then manually offset.

more to come...

-- SeanFennell? - 11 Oct 2005


Soft mods as muscle system

Clever piece of lateral thinking by TJ Galda:

To fake muscles without getting all crazy involved in springs, there are a number of ways. One neat and easy way I've discovered is this: using a soft modification tool, hook it up into a cluster to control the area of influence. Expression that bad boy up and as it slides around, you can bulge specific areas you like. Soft mods will appear to "slide" fairly well. If you go as far as animating the cluster weights, you can get some decent results. It's been used effectively in some photo real features...

and a little more info in a later email...

The soft modification tool is a Maya tool. It has an area of influence (spherical drop off) that you can write your expression to move according to a joint rotation. For example, based on the rotation of a knee joint, you could have this sphere slide up from inside and appropriately to mimic the quad's flexing. To tell exactly what is part of the quad, you can use the cluster(s) to define your region of influence (ie. what part of the model is considered as part of the muscle). This essentially allows you to have:

a) control over what is part of the muscle and
b) influence that part separately/animated/sliding via the spherical drop off area.

Reorder extra attributes, copy attributes from/to objects

You can reorder the extra attributes you added for rigging in the channel box by simply delete this attribute (RMB and menu Delete) and undo this last action (CTRL+Z) then. The extra attribute will appear at the end of the attributes list, do the same with other attributes to reorder the list. Note : works on with extra attributes.

-- NicolasdHaussy? - 15 Jul 2005

An alternative is to use 'attributeMan' (creativeCrash) which allows you to transfer attributes (and optionally their connections) between control objects and reorder them.

-- MattBernadat - 08 Feb 2010

poseDeformer

The tutorial has been moved to its own page, MayaPoseDeformer.

The Problem

At one side of the skinning spectrum is soft skinning. It's quick and easy to use, but falls short of handling complex joints like the shoulder.

At the other extreme you have muscle systems. They give amazing results, but can take a lot of time to setup and tweak, can be overkill for a simple character, inappropriate for a cartoony character, and really, unless you work for a large studio with in-house RnD, you probably don't have access to a muscle system anyway (unless you look at mike comet's cooler than cool muscle system!)

Something both those solutions miss is the ability to fix skinning problems visually, or dare I say it, artistically. If you know what the shoulder should look like at a given rotation, you should be able to just dive in and resculpt it.

The solution (in other software)

There's a middle ground between soft skinning and muscle systems, which mirai, animation master, and xsi have had for a while. [Cmon alias, whats taking you so long?]

Animation Master calls it smartskin, which are basically joint rotation driven blendshapes. It was the interface that made it nice to use. You just rotated a joint until the skin looked bad, sculpted it until it looked right, and saved that as a smartskin. You could sculpt as many corrections as you wanted in that nice, intuitive visual manner. It just worked, and it rocked.

You can fake smartskin in maya (see steven stahlberg's tut), but the workflow is unintuitive (you need to work on an undeformed copy of the model), overly complex (you need to setup the blendshape expressions yourself), and the additive nature of blendshapes meant that if you sculpted too many corrections, they would overload on each other and get ugly.

Frustratingly, a solution has been around since 2000 in the form of a siggraph paper by J.P.Lewis, [Matt Cordner, and Nickson Fong] called Pose Space Deformation: A Unified Approach to Shape Interpolation and Skeleton-Driven Deformation. He also has various code examples and notes, but maya implementations remained in-house plugins at large studios.

The solution in maya

Enter Michael Comet's poseDeformer! Its a free, open-source version of the siggraph paper available to all, and it works exactly as promised:

  • Rotate a joint until the skin looks bad
  • Resculpt it directly until it looks good, using whatever maya tools you want
  • Save it as a pose. Thats it!

Check out the sample video (560k divx 5 avi) and tell me that isn't amazing. It actually goes a few steps beyond smartskin and mirai in that you have exact control over how the poses interpolate, its pose-based rather than blendshape-based (meaning no expressions and no fighting shapes), its open source, and damnit, its in maya, meaning I can put off learning houdini for another 6 months.

The tutorial

I've moved the tutorial to MayaPoseDeformer, update your links where appropriate...

Rigging links

I've not really been keeping up with rigging stuff until recently, there's some amazing resources available. Try these:

  • http://www.rigging101.com - free rigged characters, tutorials
  • http://www.ryerdesign.com/ - more free characters, tuts
  • http://www.comet-cartoons.com/maya.html - Michael Comet's mel and pose space deformer page, unfortunately you need to compile the code for new versions of maya
  • http://www.fourthdoor.com/scripts/ - bodyBlend.mel, essentially the same as poseDeformer, but not plugin based. Thats its strength and weakness at once; good if you can't get the plugin (either because its not compiled for your system, or your production pipeline doesn't allow it), but on the flipside it creates a complex connection of utility nodes (which can get unwieldy), and the interface is a little rough at the moment. Still, really impressive, and worth a look to see how they implemented their system.
  • http://petershipkov.com - nice scripts and notes on rigging, scroll down to 'tips and tricks' for info on getting influence objects to work right.
  • http://www.maze3d.de/ - Matthias Zeller, german rigging wiz. What are they putting in the water in germany? Very nice autorig system (watch his demoreel, very impressive), and an update to the grab script by big idea. Great stuff!
  • http://morganloomis.com/

Editing smooth skins

Grab David Walden's skinningTools, its brilliant. It combines all the tools you need into one handy window, including joint rotate sliders so you can preview the skinning without having to do the keyframe trick below. Woo! He's got lots of other great scripts, all are must-haves. http://www.davidwalden.com/

component editor tab paint weights tab and joint rotate tools
skinToolsTabA.jpg skinToolsTabB.jpg

Painting weights can be easier if you stick with a clear workflow, ideally only using the additive modes (add or +ve scale). If you use subtract or smooth, maya will distribute weights where you can't see them, which can get you into trouble easily. It helps to have a structured workflow, mine is possibly a little more paranoid than most:

[optional starting steps if you have time]

  • Get into paint mode, select the top bone in the heirachy, and flood the entire mesh to 100%
  • Select the next bone down (say the left hip), set mode to 'add', value 100, and quickly paint the entire left leg just beneath the hip to be 100%.
  • Move down to the knee, do the same, repeat for each heirachy, moving from the hips out.
[end optional bit]

  • Once you're mesh is roughly weighted in this manner, set your paint options to add a small amount, say 10%, and go in and adjust weights. Again, work from the hips out.
  • Working a joint at a time, key it over 100 frames to rotate across its full range of motion. As you watch the mesh near the joint, add small values. If an area has too much influcence from the current joint, pick that joints parent or child depending on the vertex location, and add weight to that joint. Only add weights to the current joint, its parent, or its child, never subtract, never smooth.
  • You'll find the more you use paint weights, the more you'll use the component editor instead. Paint weights is good for rough blocking in, but you'll need the accuracy of the component editor a lot.

Why is paint weights so difficult?

Right, wordy and laboured analogy follows...

When you create a smooth bind, maya ensures all your vertex weights are normalised. You can choose any vertex, add up how much every joint affects that vertex, and you should get 100%. This means if you move the root joint, the skin will predicatably move with it, no vertex can be left behind or suffer double transformation issues.

An analogy can be made here with cups of sand. You have 4 empty cups, each 1/4 full of sand.

25% + 25% + 25% + 25% = 100%

You decide cup A needs to be half full, so you take a bit from the other cups to make up the amount:

50% + 16.7% + 16.7% + 16.7% = 100%

You then decide B should also be 50% so you empty the other 2 cups to get an even amount between A and B:

50% + 50% +  0% +  0% = 100%

This is more or less how the replace and add modes work in paint weights. But say you want to reduce B by 10%. You take out 10%, but where do you put it? You could drop it in C:

50% + 40% + 10% +  0% = 100%

or split it between C and D:

50% + 40% +  5% +  5% = 100%

or split it between A C and D:

53.3% + 40% +  3.3% +  3.3% = 100%

You could redistribute that 10% in many ways, but only one way might be right for your particular sand-based needs. Maybe you need D to stay empty. Maybe it should be divided equally. I don't know what you're doing with all that sand anyway, you should be using maya.

So say you chose that last case. You decide now that C should be empty. You take out that pinch of sand in the bottom, and share it among the others:

54.4% + 41.1% + 0% + 4.4% = 100%

Oh wait, we needed A to be 50... take that pinch out and share it again:

50% + 42.5% + 1.46% + 5.86% = 100%

No wait, B needed to be 40% as well:

50.83% + 40% + 2.29% + 6.69% = 100%

Now A is wrong again! And C and D are creeping up more than they should... see the pattern here? Each time you take a pinch out and redistribute it evenly, you add smaller and smaller amounts of error to the other values.

This is the problem with the smooth and subtract modes in paint weights. When you set a weight lower, maya has to stick that excess somewhere, so it takes a guess and redistributes that weight evenly to all the other joints. This is rarely what you want, so you'll try and subtract that value from the other joints, then subtract again, and again, and again.... in ever decreasing circles.

A simple skeleton in maya might have 60 bones, usually many more. If you reduce a weight by 1%, you'll get that 1% distributed evenly between 59 other bones, adding about 0.0619%. Not good, not fun to clean up.

The alias-endorsed solution is the 'hold weights' function, which allows you to remove joints from the normalisation process. So again with the sand analogy, you tell maya 'ignore C and D', and it'll only shift sand between A and B. Fine for 4 bones, but with 60 or so you spend more time toggling hold weights then you do actually painting weights. This always struck me as a hack solution anyway, a way for alias to say 'we fixed smooth skinning!' vs the more uncomfortable 'here's a problem with smooth skinning, but here's the right workflow to get around it'. Not as snazzy on a feature list I guess.

The moral of the story is, only ever use 'add'. For really accurate weights, open up the component editor, and get used to editing smooth skin weights from this view.

-- MattEstela? - 18 Dec 2004

Editing smooth skins, circa 2011

Finally good news for riggers. Since maya 2011, there is a new type of normalization, whereas (and as explained previously above) you previously needed a bone influence of exactly 1 on each vertex or faced the wrath of the wandering vertex. This does not longer hold true; you can now paint your influences as you see fit; and maya does the post normalization during animation. This is the system that most modern software packes use (xsi, 3ds) and is not nerve wrecking; it might be a little more obscure and less logical, but it's a lot more comfortable to skin.

Moreover, the paint skin weights tool has been improved a lot, and I even moved away from the ever great skinningTools.

The interactive skin binding tool

interactiveBindSkinTool

Also new with 2011 is the interactive skin bind tool, AKA capsules, familiar to those who've used skinning tools on other packages.

Instead of doing the normal Smooth Bind, select your skinning joints, your mesh and Skin > Bind Skin > Interactive Bind Skin. Every time you click a bone, you'll have a capsule that you can resize to match a pretty good rough skin. Look up the maya help file for more help but basically you can use ctrl, shift and the manipulators to stretch, scale the capsule to match the underlying bone structure.

This capsule tool is incredibly handy and allows to do a 2 hours initial skin to a 20 minute one. Once you use the paint weights tool on the newly skinned mesh, you lose the option to use the capsule and come back to the standard paint tools to refine, smooth and prune weights as usually done.

-- MattBernadat - 30 Sep 2011

Topic attachments
I Attachment Action Size Date Who Comment
jpgjpeg interactive_skin_bind1.jpeg manage 67.3 K 30 Sep 2011 - 11:12 MattBernadat interactiveBindTool
elsemel meLockSDK.mel manage 1.1 K 25 Jun 2007 - 11:13 MattEstela  
jpgjpg mirrorAfterOrient.jpg manage 10.9 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg mirrorBeforeOrient.jpg manage 10.9 K 03 Sep 2006 - 22:11 UnknownUser  
gifgif onesingleobject.gif manage 14.3 K 16 Feb 2010 - 21:15 MattBernadat Parent to Shape
jpgjpg poseReaderPlacement.jpg manage 25.7 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd05.jpg manage 24.5 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd06.jpg manage 13.0 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd07.jpg manage 8.8 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd08.jpg manage 7.9 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd09.jpg manage 8.9 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd10.jpg manage 7.6 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd11.jpg manage 26.6 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd12.jpg manage 15.4 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd13.jpg manage 10.2 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd14.jpg manage 15.8 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd15.jpg manage 33.6 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd16.jpg manage 22.8 K 03 Sep 2006 - 22:11 UnknownUser  
jpgjpg psd17.jpg manage 32.4 K 03 Sep 2006 - 22:11 UnknownUser  
gifgif sand1.gif manage 2.4 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand2.gif manage 2.3 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand3.gif manage 2.3 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand4.gif manage 2.2 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand5.gif manage 2.3 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand6.gif manage 2.3 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand7.gif manage 2.4 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand8.gif manage 2.3 K 03 Sep 2006 - 22:11 MattEstela  
gifgif sand9.gif manage 2.2 K 03 Sep 2006 - 22:11 MattEstela  
jpgjpg skinToolsTabA.jpg manage 13.3 K 03 Sep 2006 - 22:11 MattEstela  
jpgjpg skinToolsTabB.jpg manage 13.3 K 03 Sep 2006 - 22:11 MattEstela  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r9 < r8 < r7 < r6 < r5 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback