Perfecting the Armature to also function as a rig for the Armor

So, in the previous recipe, we have built the body deforming Armature for the Gidiosaurus character.

However, the Gidiosaurus is an (almost) evolved and a civilized creature, and being also a warrior, it wears a metallic Armor; this armor will need to be later parented to the rig as well in order to be animated.

Some of the bones that we have already created will be perfect to skin the Armor object too, by assigning the right vertex group to the right mesh part (for example, the head vertex group for the Helm or the chest vertex group for the Breastplate). However, because the Armor is made also by different parts that cannot be simply driven by the already existing bones (for example, the belts, Vambraces, and especially Groinguard), some modification and/or addition to the rig must be done anyway.

Getting ready

Start from the previously saved Gidiosaurus_rig_from_scratch_01.blend file:

  1. Enable the 13th scene layer to show the Armor object.
  2. Select it and go to the Object Modifiers window under the main Properties panel. Expand the Subdivision Surface modifier tab and click on the Display modifier in viewport button, the one with the eye icon, to disable it.
  3. Go to the Outliner and click on the arrow icon to the side of the Armor item to make it unselectable.
  4. Click on the arrow icon to the side of the Gidiosaurus_lowres item to make it unselectable as well.
  5. Save the file as Gidiosaurus_rig_from_scratch_02.blend.

How to do it…

Let's start by adding bones dedicated to the Armor:

  1. Go into Edit Mode and select the forearm.L bone; use Shift + D to duplicate it and rename it vanbrace.L. Press M and in the Change Bone Layers pop-up, click on the 2nd button to move the duplicated bone to that bone layer.
  2. Do the same for the forearm.R bone (vanbrace.R) and for the calf.L (greave.L) and calf.R bones (greave.R).
  3. Now, go to the Object Data window and click on the 2nd button under the Layers item in the Skeleton subpanel, in order to show only the four duplicated bones in the 3D viewport; press Tab to get out of Edit Mode.
  4. Select the vanbrace.L bone and go to the Bone window under the Deform subpanel; under the Curved Bones item, set back the Segments and Ease In and Ease Out values to default, that is, 1, 1.000 and 1.000.
  5. Go back into Edit Mode and click on the Connected item under the Relations subpanel.
  6. Get out of Edit Mode and go to the Bone Constraints window under the main Properties panel (not to be confused with the Object Constraints window); click on the Add Bone Constraint button and select a Copy Rotation constraint from the pop-up menu (the bone turns light green, in order to show that it has a constraint assigned now).
  7. In the Target field, select Armature; in the Bone field, select the forearm.L item; in the Space fields, select Pose Space for both.

    Alternatively, for steps 6 and 7, select the forearm.L bone and then use Shift to select the vanbrace.L bone. Hence, press Shift + Ctrl + C to call the Add Constraint (with Targets) pop-up menu and select the Copy Rotation item. This will automatically add the Copy Rotation constraint to the vanbrace.L bone, with the first select bone (forearm.L) as a target; the other setting must be enabled and/or tweaked in the constraint subpanel instead.

  8. Click again on the Add Bone Constraint button and this time, select an Inverse Kinematics constraint (the bone turns yellow, in order to show that an IK solver has been assigned). In the Target field, select the Armature item, in the Bone field, select the hand.L bone, and set the Chain Length to 1; deselect Stretch and select Rotation, lowering the weight to the minimum (that is 0.010):
    How to do it…

    The constraints assigned to the forearm.L b-bone

  9. Repeat the steps from 4 to 8 for the other three duplicated bones (obviously, setting the appropriate bones as targets for each pair of constraints; the target bone for the IK constraint assigned to the greave bones is the respective foot bone).

    The rig can now drive the vambraces and greaves; let's see the knee guards and Groinguard.

  10. First, switch the Armature visualization back to Octahedral, then go into Edit Mode, select the hips bone and use Shift + D to duplicate it; in the Side view, rotate the duplicate 170 degrees, then move it on the Groinguard part of the armor, in order to have the Head of the bone placed to the joint of the plate with the ties; select the Tail of the groinguard bone and scale it smaller to fit the part.
  11. To position the bone more precisely, go to the Transform subpanel under the Properties 3D view sidepanel and set the following values for the Head (of the bone): X = 0.001, Y = 0.020, and Z = 1.147; for the Tail set the following values: X = 0.001, Y = 0.022, and Z = 0.873.
  12. Go to the Item subpanel and rename the bone from hips.001 to groinguard:
    How to do it…

    The groinguard bone

  13. Go to the Bone window in the main Properties panel, and under the Relations subpanel, click on the Parent empty slot to select the hips item.
  14. Now, select the joint of the leg.L bone with the calf.L bone and press Shift + S | Cursor to Selected; press Shift + A to add a new bone and rescale it smaller.
  15. Select the whole new bone and use Shift to select the calf.L bone. Then, go in the 3D view toolbar and click on the Armature item; go to Transform | Align Bones (or else, press the Ctrl + Alt + A keys) to align the new bone as the calf.L one.
  16. Enable the widget (Ctrl + spacebar), set the Transform Orientation to Normal, and the rotation pivot on the 3D Cursor. Then, rotate the new bone 110 degrees on the normal x axis (the red wheel of the widget, or else R | X | X | 110 | Enter):
    How to do it…

    Aligning the new bone

  17. Go into Object Mode and press Shift + S | Cursor to Selected to place the 3D Cursor at the median pivot point of the Armature; go back into Edit Mode, press Shift + D to duplicate the new bone, then Ctrl + M | X to mirror it on the other side.
  18. Rename the new bones as kneeguard.L and kneeguard.R; enable the axis visibility and recalculate the roll by the Ctrl + N | Active Bone tool:
    How to do it…

    Recalculating the roll angle of the kneeguard bones

  19. Parent the kneeguard.L bone to the leg.L bone and the kneeguard.R bone to the leg.R one (not connected).
  20. Select the groinguard bone and use Shift + D to duplicate it, and then scale the duplicated bone a little bit bigger and rename it as groinguard_ctrl; uncheck the box of the Deform subpanel under the Bone window:
    How to do it…

    Creating a control bone for the groinguard bone

  21. Select the groinguard bone, go to the Relations subpanel, and click in the Parent field to select the groinguard_ctrl bone.
  22. Get out of Edit Mode and in Pose Mode, select the groinguard_ctrl bone.
  23. Go to the Bone Constraints window under the main Properties panel; click on the Add Bone Constraint button and select a Locked Track constraint from the pop-up menu.
  24. In the Target field, select the Armature item; in the Bone field, select the kneeguard.L item. Set the Head/Tail value to 0.500: To (Axis that points to the target object) = -X and Lock (Axis that points upward) = Y. In the Constraint Name field, rename it as Locked Track.L.
  25. Add a new Locked Track constraint and repeat everything as in the previous one, except in the Bone field, select the kneeguard.R item; rename it as Locked Track.R.
  26. Add a Damped Track constraint: Target = Armature, Bone = kneeguard.L, Head/Tail = 0.728, To = Y, and Influence = 0.263. Rename it as Damped Track.L.
  27. Add a new Damped Track constraint and repeat everything as in the previous one, except again in the Bone field, select the kneeguard.R item; rename it as Damped Track.R.
  28. Just to be sure, save the file!
  29. Go back into Edit Mode and in the Side view, select the chest bone and use Shift + D to duplicate it. Press W to call the Specials pop-up menu and select the Switch_Direction item, or else press Alt + F directly:
    How to do it…

    The Specials pop-up menu for the bones

  30. Go to the Bone window and click on the Parent slot under the Relations subpanel to select the chest item (not connected); then, go to the Deform subpanel and set the Segments under Curved Bones to 1. Rename the new bone as armor_ctrl.
  31. Press Ctrl + R to roll the armor_ctrl bone, in order to be sure that its local x axis is pointing towards the front of the model; this is important to make the Transformation constraints, which we'll add later, work properly:
    How to do it…

    The armor control bone

  32. Go in the Front view. Note that the X-Axis Mirror item in the Armature Options panel under the Tool Shelf is still enabled; select the Tail of the shoulder.L bone and extrude a new bone going towards the external edge of the armor spaulder. Then, select the extruded bone, press Alt + P | Clear Parent, and move its Head to be positioned above the joint of the spaulder with the chest plate.
    How to do it…

    Creating the bone for the spaulder

  33. Rename the extruded bone and the corresponding mirrored one as spaulder.L and spaulder.R; parent them to the armor_ctrl bone (enable the Keep Offset item).
  34. Use Shift to select the spaulder.L and arm.L bones and press Ctrl + N | Active Bone; do the same with the spaulder.R and arm.R bones.
  35. Now, put the 3D Cursor at the spaulder.L bone's Head location, and then set the Pivot Point to the 3D Cursor in the 3D window toolbar. Use Shift + D to duplicate the spaulder.L bone and rotate the duplicate 70 degrees (in the Front view, R | 70 | Enter).
  36. Place the 3D Cursor at the shoulder.L bone's Tail location, select the duplicated bone, and press Shift + S | Selected to Cursor. Rename the duplicated bone and the mirrored one as rotarmor.L and rotarmor.R. Go to the Relations subpanel and set the rotarmor.L bone as the child of the arm.L bone and the rotarmor.R bone as the child of the arm.R bone. Disable the Deform item for both of them:
    How to do it…

    Using the 3D Cursor and the Snap menu to exactly place the bones

  37. Go into Pose Mode. Select the spaulder.L bone and in the Bone Constraints window, assign a Copy Rotation constraint: Target = Armature, Bone = arm.L, Space = Pose Space to Pose Space, and Influence = 0.200.
  38. Select the spaulder.R bone and repeat with the Bone = arm.R target.
  39. Now, select the armor_ctrl bone and assign a Transformation constraint. Set Target = Armature, Bone = rotarmor.L, Source = Rot, and Z Max = 20°; Source To Destination Mapping = switch X with Z; Destination = Rot, X Max = 4°, and Space = Pose Space to Pose Space. Rename the constraint as Transformation_rot.L and collapse the panel.
  40. Assign a second Transformation constraint; set everything as in the previous one, except for the target Bone = rotarmor.R, Source = Rot, Z Min = -20°, and Destination X Min = -4°. Rename the constraint as Transformation_rot.R and collapse it.
  41. Assign a third Transformation constraint; set everything as in the first one, except do not switch X with Z, set Destination = Loc and Z Max = 0.050. Rename the constraint as Transformation_move.L and collapse it.
  42. Assign a fourth Transformation constraint; set everything as in the second one, except do not switch X with Z; set Destination = Loc and Z Min = 0.050. Rename the constraint as Transformation_move.R and collapse it.
  43. Save the file.

How it works…

We couldn't directly use the forearm and calf bones to rig the vanbraces and greaves parts because being subdivided B-bones, they would curve these armor parts along the length as they actually do by deforming organic parts as the forearms and shins, and this would look awkward, as you can see in the following screenshot:

How it works…

B-bones erroneously deforming stiff objects

Instead, we just duplicated the bones, restored Segments and Ease In and Ease Out to default values, and assigned 2 bone constraints (note that, as already mentioned, the bones have a Bone Constraints panel of their own, which is different from the Object Constraints one).

The Copy Rotation constraint, as the name itself explains, copies the rotation in space of the target B-bone; the position inside the chain is granted because the duplicated bones, although not connected, are children of the same bones as the original ones.

The Inverse Kinematics constraint—in this case, is used simply to track the local y rotation of the hand bone in order to rotate correctly on its y axis— is necessary because the Copy Rotation constraint doesn't seem to read the local y rotation of a subdivided B-bone (besides the technical details, it makes sense because that's actually not a rotation in space):

How it works…

The correct rotation of the stiff armor parts

The constraints assigned to the groinguard_ctrl bone are a cheap, but quite an effective, way to fake a rigid body simulation for the plate that—in actions, for example, a walk cycle—should interact by colliding with the Gidiosaurus thighs. The Locked Track constraints, targeted to the leg bones, automatically rotate the plate according to the thighs movements, and the Dumped Track constraints, targeted to the leg bones as well but with a low influence, add a swinging movement.

The groinguard bone, actually the one affecting the armor plate, is the child of the groinguard_ctrl bone, and so it inherits the constraint's movements but can be used to refine, tweak, or modify the final animation of the plate by hands:

How it works…

The groinguard bone (and plate) automatically rotating during the walk cycle

The armor_ctrl bone is the bone controlling the armor's Breastplate; it's the child of the chest bone, so it inherits the rotation of the chest, but has four Transformation constraints.

By using as an input the rotation angle of the rotarmor.L and rotarmor.R bones (which are children themselves of the arm.L and arm.R bones), the constraints give to the Armor chest plate a slight rotation on the vertical axis and a lateral swinging, driven by the oscillations of the Gidiosaurus arms, and simulating of the character's shoulders colliding with the armor plate during the walk.

Also, the spaulders are, in turn, partially rotated by bones with the Copy Rotation constraints targeted to the arms, but with quite a low influence.

Although better appreciated in motion, the following screenshot will show you the effects as the arms rotate backward:

How it works…

The rotation and swinging of the armor chest plate according to the arms' movements

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.98.240