====== Rigging ====== Skeletons are made of bones, which are composed of a tail, a body and a head. Bones can be extruded out of tails of other bones with **''E''** while in **Edit mode**. Alternatively, you can scale up a bone and then subdivide it to break it down into multiple bones. Rotating bones in edit mode makes them rotate around the body center if the pivot point is set to bounding box. However, **rotating in edit mode does not modify the local object orientation** (which can thus stay aligned with the global orientation), while rotating in object mode will also rotate it's local orientation. Use the 3D cursor as a pivot point to handily rotate a bone or armature in edit mode. ==== Pose mode ==== When selecting bones, there is an additional **Pose mode** available on top of the Object and Edit modes. In **Pose mode**, bones will rotate around the head joint. **''G''** to grab any child bones will make them rotate around their head and not move. Only the top parent bone can actually move. Duplicating a bone in edit mode and moving it outside the armature will keep the parent/child relationship but the separated bone can be freely moved around. You can clear parents with **''ALT'' + ''P''** or reparent bones together with **''CTRL'' + ''P''**. When parenting bones there is an option to either keep offset (if the bone is moved away from the selected parent) or connect (to snap the bone head to the parent's tail). When several bones are stacked on top of each other **''ALT'' + ''LEFT CLICK''** opens a selection menu to choose which bone to select. Even in pose mode, scaling will act like a normal parenting relationship and scale the children as well. When swapping between Edit and Pose mode, the Edit mode will conserve neutral position of bones while the Pose mode will conserve the way the bones were moved. The **''ALT'' + ''G'' / ''R'' / ''S''** hotkeys are handy to remove any movement/rotation/scale applied to a bone hierarchy and reset the pose mode. When in Pose mode of a hidden armature, it's not possible to select another armature. Toggle back to Object mode to do the swap. ---- ===== Rigging ===== It's best to **Apply scale** before parenting a mesh to an armature. Keeping a slight bend on arms and legs can help a lot in the rigging process. ==== Attaching Bones ==== Bones can be made to display on top of meshes in **Data > Viewport Display >> In Front**. Meshes are attached to the bones following the same parenting process **''CTRL'' + ''P''** as with meshes. Bones attach to the mesh's vertices (Vertex Groups), so take care the mesh has enough topology to follow the bones movements and rotations. === Bone Roll === Remember when creating an armature to check and adjust the bone roll for each bone depending on how the bone is meant to rotate around it's joint. Often the Z will be facing forward (but not always) and most of the time the X will stay parallel to the global X. === Root bone === It's generally useful to have a root bone aligned with the World origin and have that at the top of the hierarchy. The **Root bone's function** is generally to move the character around in 3D space while animating a walk cycle for example. On humanoids, it's also more convenient to have a hip controller sticking out the back to move the upper part of the character rather than having to select the lower spine. In terms of parenting, the hip controller should be parented to the root bone as well as any IK target, and the IK pole should be parented to the IK target to keep it always in front of the IK rig part. === Deform before Symmetrize === Controller bones (root bones, targets, poles, etc.) should not deform the mesh. Take care to select them and under **Bone Properties** uncheck **Deform** Once that is done, select the entire armature and **''RIGHT CLICK'' > Symmetrize**. === Tips === Snapping to Volume can be handy to get the bones to attach to the proper points of the mesh. You can attach separate objects to a same armature (handy for clothes, backpacks, weapons, etc.) ==== Naming conventions ==== When doing a humanoid basic rig, it's handy to do one side in front view then mirror to the other side. The naming convention ''.L'' or ''.R'' after the name of each bone helps Blender rename correctly the other side when the mirror is applied. To rig a basic humanoid, it's useful to have it in a T shape pose facing forward. ==== Weight Painting ==== Weight painting controls the Vertex Groups for the different bones of a skeleton attached to a mesh. In Edit mode, selecting individual vertices will display the vertex group influences under the **Options (''N'') > Item** tab. When going into weight paint mode, select the entire armature first, then the mesh, then go into weight paint mode. If you only select the mesh it will only display the weight paint of the last selected bone. This way you can **''CTRL'' + ''SHIFT'' + ''LEFT CLICK''** (or **''ALT'' + ''LEFT CLICK''**) the different bones to see their influence. It's possible in weight paint mode to select a bone and rotate it to visualize the influence it has on the mesh. The **color gradient indicates each selected bone's influence** on the mesh : red for 100% attachment to vertices and blue for 0%. When weight painting do not confuse the **Weight** property (ink color) to the **Strength** property (ink flow) === Auto-Normalized === When weight painting, a part of the mesh can be influenced by different parts of the armature. Weight painting for one part of the armature does not remove the influence from the other parts. Under the **Options** menu tick the **Auto normalize** option to limit to 1 the influence applied to the vertices of the objects. This will effectively remove the influence of other bones when painting up to 1 on a mesh for a given bone. === Brushes === Use a combination of: ***Paint** to directly apply a quantity of influence ***Smear** to smear one influence into another ***Blur** to even out the influence transitions. ---- ===== Rigify Rigs ===== **Rigify** can be activated in **Preferences > Add-ons**. When using Rigify, make sure **Auto-run Python Scripts** is also enabled under **Preferences > Save & Load **. When rigging with this add-on, a lot of the joints are actually not connected to each other (finger bones are a good example) but it is important to keep them on top of each other. Use **box select** to ensure you select everything at the same time before moving around. ==== Positionning the rig ==== Keep **X-axis mirror** enabled in the **Options** menu to replicate any changes made to the hands and legs on the other side. You can **''H''** to hide any part of the rig getting in the way for a better visibility of some parts of the rig while working on them. Always keep a slight bend inwards to the arm and a slight bend downwards for the fingers. Enable the visibility of axes to check the roll and correct any roll that doesn't align properly. Fingers should roll along their X axis (except the thumb apparently) and have the Z axes facing down. The entire face bones can be removed if animating the face is not intended. When doing the legs, the **heel.02** bone needs to be perfectly aligned with the bottom corner of the heel and the bone should be scaled to have the same width as the foot. ==== Generating the rig ==== {| class="wikitable" |rowspan="5" | {{:3d:rigify-rig-generated.png?direct&200|}} |style="padding-left: 10px;"|The metarig we place on our mesh is not the actual rig used with Rigify. |- |style="padding-left: 10px;"|Once it's in place, under **Data > Rigify** select **Generate Rig**. |- |style="padding-left: 10px;"|If for any reasons some bones were disconnected from the chain, the generation will process but result with errors indicating which bones are disconnected. |- |style="padding-left: 10px;"|Use **Vertex Snapping** to easily reconnect any disconnected bones in the chain and **Re-generate Rig**. |- |style="padding-left: 10px;"|The generated rig is the rigify rig with all the controllers and is the one that will be parented to the mesh. |} ---- === Rigify Color Code === ***Red** indicates **Inverse Kinematics (IK)**. ***Green** indicates **Forward Kinematics (FK)** and when those are selected, the **Rig Main Properties** option //(see below)// proposes a slider to move the mesh from the IK rig (full 0.0) to the FK rig (full 1.1). ***Blue** indicates **Tweak** bones that allow a little bit of deformation on the mesh that can be useful in certain poses. ***Yellow** indicates the **Torso** parts and when moving those, the entire body will follow. FK body parts will follow along the movement but IK body parts will remain in their IK controller position. ---- === Item properties === When selecting a bone from a Rigify rig, additional options are available under **Item > Rig Main Properties** in the Viewport display. For example, when moving an IK part of the rig far away from the model, it stretches, and this stretch can be controlled in these properties. This property can be animated to select FK or IK according to which one is more advantageous for the required pose. In the **Item** properties the **Rig Layers** can be arranged to enable/disable visibility of parts of the rigify rig for more clarity in the Viewport display. ---- === Finger controllers === The finger controllers can be **''S''** to scale and this will curl the fingers inwards to close the hands. It's good practice to check that the curl doesn't twist and correct if necessary. Correcting twists in fingers can involve editing the mesh slightly if it seems to be slightly rotated the wrong way. ---- === Rig re-generation === When re-generating the rig, the new one replaces the old one. The parenting is kept but so are the weights from the previous parenting. If bones were moved, it's best to re-parent the new rig to the mesh with automatic weights to re-generate them. Make sure the rig works perfectly well before going into weight modification. ---- === Weight Painting Rigify === The generated rig creates a set of deform bones which are hidden by default but reference the **DEF-xxx** vertex groups automatically created on the mesh. These deform bones can be toggled visible by going to the **Data > Bone Collection** section under the name **DEF** Then select rig then mesh and go into weight paint mode.