From BlenderWiki

Jump to: navigation, search

Skinning to Shapes

Mode: Object or Pose modes

Panel: Modifiers (Editing context, F9)

Hotkey: CtrlP

We saw in the previous page how to link (parent) whole objects to armature bones – a way to control the transform properties of this object via a rig. However, armatures are much more powerful: they can deform the shape of an object (i.e. affect its ObData datablock – its vertices or control points…).

In this case, the child object is parented (skinned) to the whole armature, so that each of its bones controls a part of the “skin” object’s geometry. This type of skinning is available for meshes, lattices, curves, surfaces, and texts (with more options for the first two types).

Bones can affect the object’s shape in two ways:

  • The “envelopes” process is available for all type of skinnable objects – it uses the “proximity” and “influence” of the bones to determine which part of the object they can deform.
  • The “vertex groups” method is (obviously) reserved to meshes and lattices – one bone only affect the vertices in the group having the same name, using vertices’ weights as influence value. A much more precise method, but also generally longer to set up.

Both methods have some common options, and can be mixed together.

Parenting to Whole Armatures

But before diving into this, let’s talk about the different ways to skin (parent) an object to a whole armature – as with object skinning, there is an “old parenting” method and a new, more flexible and powerful one, based on modifiers – which allows to create very complex setups, with objects deformed by several armatures…

The Make Parent To menu in Object mode, when using an armature as parent.
The Create Vertex Groups? menu, when parenting a mesh to an armature.

For meshes and lattices only, you can use the CtrlP parent shortcut in the 3D views (after having selected first the “skin” object, then the armature). The Make Parent To menu pops-up, select the Armature entry. If the skinning object is a lattice, this is done, no more options are available. But with a child mesh, another Create Vertex Groups? menu appears, with the following options – all regarding the “vertex groups” skinning method:

  • Don’t Create Groups won’t modify at all the current mesh’s vertex groups – choose this one if you do not intend to use vertex groups at all for your skinning.
  • Name Groups will create, if they don’t already exist, empty groups, one for each bone in the skinned armature, with these bones’ names. Choose this option if you have already created (and weighted…) all the vertex groups the mesh requires.
  • Create From Envelopes will create, as with Name Groups option, the needed vertex groups. However, it will also weight them according to the bones’ envelope settings (i.e. it will assign to each groups the vertices that are inside its bone’s influence area, weighted depending on their distance to this bone). This means that if you had defined vertex groups using same names as skinned bones, their content will be completely overridden! You’ll get the same behavior as if you used the envelopes skinning method, but with vertex groups…
  • Create From Bone Heat will create, as with Create From Envelopes option, the needed vertex groups, with vertices assigned and weighted using the newer “bone heat” algorithm. --Mont29 13:04, 21 May 2010 (UTC)).


The “virtual old parenting” armature modifier.
The Armature modifier.

This “parenting” method will create a “virtual” modifier in the skinning object’s modifiers stack – you can always transform it to a real one by clicking on the Make Real button. And so, of course, adding an Armature modifier to an object is the second, new skinning method (working also for curves/surfaces/texts…). Follow the above link to read more about this modifier’s specific options. Note that there is a way with new Armature modifiers to automatically create vertex groups and weight them, see the vertex groups method description below.

Exclamation mark.png
A same object can have several Armature modifiers (with e.g. different armatures, or different settings…), working on top of each other, or mixing their respective effects (depending whether their MultiModifier option is set, see their description for more details), and only one “virtual old parenting” one, which will always be at the top of the stack.

Note finally that for settings that are both present in the armature’s Armature panel and in the objects’ Armature modifier panel (namely, Vertex Groups/VertGroups, Envelopes, Quaternion and B-Bone Rest), the modifier ones always override the armature ones. This means that if, for example, you only enable the Envelopes deformation method of the armature, and then skin it with an object using an Armature modifier, where only VertGroups is enabled, the object will only be deformed based on its “bones” vertex groups, ignoring completely the bones’ envelopes.

Common Options

Mode: Object or Pose modes

Panel: Modifiers (Editing context, F9)

Hotkey: CtrlP

The Armature panel.

There are two armature-global skinning options that are common to both envelopes and vertex groups methods:

Quaternion (Armature panel and modifier)
This affects the way geometry is deformed, especially at bone’s joints, when rotating them.
Without Quaternion, rotations at joints tend to scale down the neighbouring geometry, up to nearly zero at 180° from rest position.
With Quaternion, the geometry is no more scaled down, but there is a “gap”, a discontinuity when reaching 180° from rest position.
Example of Quaternion option effects.
Initial state.
100° rotation, Quaternion disabled.
180° rotation, Quaternion disabled.
100° rotation, Quaternion enabled.
179.9° rotation, Quaternion enabled.
180.1° rotation, Quaternion enabled.
Note that the IcoSphere is deformed using the envelopes method.
B-Bone Rest (Armature panel and modifier)
This option affects how multi-segmented (Bézier) bones deform their geometry when in rest position:
  • When disabled, even though the bones are curved (use the B-Bone visualization to check that), in rest position the skin object remains undeformed (keeps its original shape).
  • When enabled, even in rest position, the skin object is deformed to “follow” the curved bones.
Example of B-Bone Rest option effects.
Rigid tube skinned on the smooth bones, B-Bone Rest disabled (Stick visualization).
Same thing, but in B-Bone visualization.
Same thing, but with B-Bone Rest enabled – the tube is now curved, following tightly the bone’s shapes.
100° rotation, B-Bone Rest disabled – the rigid tube is now curved, but based on its rest rigid state.
100° rotation, B-Bone Rest enabled – the tube still follows tightly the curved bones.
Same thing, but back to Stick visualization.
Note that the tube is deformed using the envelopes method. The two segmented bones contain eight segments.
The Armature Bones panel and bones’ sub-panels in Pose mode.

The bones also have some deforming option in their sub-panels (Armature Bones panel), that you can hence define independently for each of them:

Deform
By disabling this setting (enabled by default), you can completely prevent a bone from deforming the geometry of the skin object.
Mult
Short for 'Multiply'. This option controls how the two deforming methods interact when they are both enabled. By default, when they are both active, all vertices belonging to at least one vertex group are only deformed through the vertex groups method – the other “orphan” vertices being handled by the envelopes one.
When you enable this option, the “deformation influence” that would have this bone on a vertex (based from its envelope settings) is multiplied with this vertex’s weight in the corresponding vertex group. In other words, the vertex groups method is further “weighted” by the envelopes method.


Envelopes

Bone influence areas for envelopes method.

Envelopes is the most general skinning method – it works with all available object types for skinning (meshes, lattices, curves, surfaces and texts). It is based on proximity between bones and their geometry, each bone having two different areas of influence, shown in the Envelope visualization:

  • The inside area, materialized by the “solid” part of the bone, and controlled by both root and tip radius. Inside this zone, the geometry if fully affected by the bone.
  • The outside area, materialized by the lighten part around the bone, and controlled by the Dist setting. Inside this zone, the geometry is less and less affected by the bone as it goes away – following a quadratic decay.

See the editing pages for how to edit these properties.

There is also a bone property, Weight (in each bone sub-panel, in Edit mode only, defaults to 1.0'), that controls the global influence of the bone over the deformed object, when using the envelopes method. It is only useful for the parts of geometry that are “shared”, influenced by more than one bone (generally, at the joints…) – a bone with a high weight will have more influence on the result than one with a low weight… Note that when set to 0.0, it has the same effect as disabling the Deform option.

Vertex Groups

Vertex groups skinning method is only available for meshes and lattices – the only objects having vertex groups! Its principle is very simple: each bone only affects vertices belonging to a vertex group having the same name as the bone. So if you have e.g. a “forearm” bone, it will only affect the “forearm” vertex group of its skin object(s).

The influence of one bone on a given vertex is controlled by the weight of this vertex in the relevant group. Thus, the Weight Paint mode (Ctrl⇆ Tab with a mesh selected) is most useful here, to easily set/adjust the vertices’ weights.

However, you have a few goodies when weight-painting a mesh already parented to (skinning) an armature. For these to work, you must:

  • Select the armature.
  • Switch to Pose mode (Ctrl⇆ Tab).
  • Select the mesh to weight.
  • Hit again Ctrl⇆ Tab to switch to Weight Paint mode.

Now, when you select a bone of the armature (which remained in Pose mode), you automatically activate the corresponding vertex group of the mesh – Very handy! Obviously, you can only select one bone at a time in this mode (so ⇧ ShiftLMB Template-LMB.png clicking does not work).

This way, you can also apply to the active bone/vertex group one of the same “auto-weighting” methods as available when doing an “old-parenting” to armature (CtrlP):

  • Select the bone (and hence the vertex group) you want.
  • Hit W, and in the Specials menu that pops-up, chose either Apply Bone Envelopes to Vertex Groups or Apply Bone Heat Weights to Vertex Groups (names are self explanatory, I think…). Once again, even though these names are plural, you can only affect one vertex group’s weights at a time with these options.

To automatically weight multiple bones, you can simply

  • Ctrl⇆ Tab out of Weight Paint Mode
  • Select the Armature, it should be in Pose mode. If it isn't, go Ctrl⇆ Tab
  • Select multiple bones ⇧ ShiftLMB Template-LMB.png or hit 'a' ( maybe twice ).
  • Select Mesh again
  • If not in weight paint already, toggle back into Ctrl⇆ Tab
  • Use the W menu to automatic weight. This will weight all the bones you selected in Pose Mode.
Example of vertex groups skinning method.
The weights of the arm vertex group.
The weights of the forearm vertex group.
The result when posing the armature.
The same pose, but using envelopes method rather that vertex groups.

Obviously, a same vertex can belong to several groups, and hence be affected by several bones, with a fine tuning of each bone’s influence using these vertex weights. Quite useful when you want to have a smooth joint. For example, when you skin an elbow, the upperarm vertex group contains the vertices of this part at full weight (1.0), and when reaching the elbow area, these weights decrease progressively to 0.0 when reaching the forearm zone – and vice-versa for the forearm group weights… Of course, this is a very raw example – skinning a realistic joint is a big job, as you have to carefully find the good weights for each vertex, to have the most realistic behavior when bending – and this is not an easy thing!

See Also

Making good but short examples about skinning to shapes is not an easy thing – so if you want greater examples, have a look to this BSoD tutorial, which illustrates (among many other things) the skinning of a simple human rig with a mesh object.