Creating shape keys

In this recipe, we'll set the shape keys to create (even if limited) facial expressions and to fake the stretching and the contracting effect of the character's arm muscles, and we'll add some more shape keys to fix issues in the character's shape.

Getting ready

First, let's prepare a bit the scene and the model:

  1. Start Blender and load the Gidiosaurus_skinning_rigify.blend file, which is the same as the Gidiosaurus_skinning_03.blend file but with the rig created by the Rigify add-on (and later edited to add the other bones exactly as explained in the last chapter's recipes).
  2. In the Outliner, click on the respective eye icons to hide the Armor, Eyes, and Tiers_simplified objects and the Armature, whose name in this case is rig.
  3. Select the Gidiosaurus_lowres object and press the 1 key on the numpad to go into the Front view.
  4. Press Z to go into the Wireframe viewport shading mode and the 5 key on the numpad to switch to the Ortho view if it is not already.
  5. Enter Edit Mode and box-select the left half of the mesh vertices (including the middle vertical edge-loop) and in the Vertex Groups subpanel under the Object Data window, create a new vertex group; rename it left and assign the selected vertices a weight of 1.000.
  6. Deselect everything and repeat this process for the right half of the mesh's vertices to create the right vertex group:
    Getting ready

    Assigning the mesh's right side vertices to the "right" vertex group

  7. Save the file as Gidiosaurus_shapekeys.blend.

How to do it…

Let's start now by creating the facial expressions shape keys:

  1. Exit Edit Mode and expand the Shape Keys subpanel under the Object Data window; click on the + icon button to the top left to create the Basis shape key (that mustn't be edited), then click once more to create the Key 1 shape key (that is, instead, the one to be edited):
    How to do it…

    Creating the Basis and the first shape key

  2. Be sure that the X Mirror item in the Mesh Options tab under the Tool Shelf is activated and click on the PET (Proportional Editing Tool) button in the 3D viewport toolbar (or activate it by pressing the O key).
  3. Zoom to the Gidiosaurus head and again in Edit Mode, select some of the vertices at the center of the snout area, as indicated in the following screenshot:
    How to do it…

    Selecting the vertices

  4. Move them upwards and towards the eye, set the amount for the PET smoothing by scrolling the mouse wheel:
    How to do it…

    Moving the selected vertices slightly backwards and upwards

    Note that we selected two faces instead of the folder edges, because the muscular scrunching involves both movement of the skin and a slight folding of the skin as well; the middle edge does not move as much as the selected faces due to PET falloff, hence creating a very slight scrunch and a more naturalistic skin sliding.

  5. If necessary, adjust the position of the single vertices, maybe also disabling the PET.
  6. Go to the Shape Keys subpanel and rename the Key 1 shape key as grin.
  7. Click on the Apply shape key in edit mode button located right above the Value slider to enable it; go into the Front view and by moving the Value slider from 0.000 to 1.000 and back, check for the correct working of the shape key on both the sides of the character:
    How to do it…

    Checking how the "grin" shape key works

  8. Go out of Edit Mode and just to have better visibility of the shape key modifications, go to the Object window to enable the Wire item in the Display subpanel.
  9. Go back to the Object Data window and click on the button that has an icon of a downward pointing arrow (Shape keys specials); from the pop-up menu select the New Shape from Mix item: this adds a new shape key made by the sum of all the active shape keys. In this case, it is just a perfect copy of the sole grin shape key (the Basis shape key is, well, just the base starting position of the vertices in the mesh). Rename the two shape keys as grin.L and grin.R.
    How to do it…

    Copying the "grin" shape key to a new one

  10. Click on the grin.L shape key, set the Value slider back to 0.000, and then click on the Vertex weight group slot, the one under the Blend item and above the Basis one, and select the left vertex group.
  11. Repeat for the grin.R shape key by selecting the right vertex group, and then once again set the Value slider to 1.000 and ensure it works correctly.

    Each shape key now works only on the respective side, according to the selected vertex group:

    How to do it…

    The two "grin" shape keys for the right and the left sides

    This was for the grin expression; now we need to add at least two or three more kinds of shape keys, namely: two for the eyebrows (up and down) and one for the nostrils, multiplied for each side.

    This means six more shape keys in total, but as you have seen, the procedure is quite quick and simple.

  12. Set the Value slider for the grin.L and grin.R shape keys back to 0.000 and click on the + icon button to add a new shape key.
  13. Rename it eyebrow_up.L and enter Edit Mode; grab some vertices on the left eyebrow and, still with the PET activated, move them upward; you can use the mouse wheel to set the influence of the PET:
    How to do it…

    Moving the eyebrow upward

  14. Repeat the steps from 9 to 11 to create the eyebrow_up.R shape key.
  15. Repeat the steps from 3 to 11 to create the eyebrow_down.L and eyebrow_down.R shape keys:
    How to do it…

    Moving the eyebrow downward

  16. Finally repeat step 3 to step 11, this time selecting the vertices around the nostrils and scaling them to be bigger, creating the snare.L and snare.R shape keys:
    How to do it…

    The nostril flaring

    Note that, when naming the shape key for the enlargement of the nostrils, I erroneously wrote snare; it should have been something like snarl or flaring, but in the end it's just a naming convention and therefore, this little mistake doesn't pose a real problem.

    We are done with the facial expressions; now let's add one more shape key to enhance some of the body features of the Gidiosaurus a bit; these are not meant to be animated during the animation, but are simply a way to apply non-destructive modifications to the model.

  17. Add a new shape key and rename it prop (for proportions).
  18. In Edit Mode, select the vertices of the left foot, excluding the feet talons, and press Alt + S to scale them on their normals; if you are using the PET, just be sure to be in the Connected mode (so that the PET has influence only on the vertices connected to the selected ones, otherwise the unselected feet talon vertices will also be modified):
    How to do it…

    Modifying the feet proportions

  19. Disable the PET and adjust the transition between the scaled vertices and the surrounding ones, the area between the two toes, and so on.
  20. If you wish, you may also make additional modifications; in my case, besides the bigger feet, I simply enhanced the knuckles on the hands and at the fingers' joints. Also, I tweaked the rim shape of the upper and bottom borders of the mandibles a bit:
    How to do it…

    Enhancing some of the character's features

  21. When you are done, set the Value slider of the prop shape key to 1.000.

    Now, let's add a couple of shape keys to mimic the movement of the main muscles of the arms, specifically of the biceps and of the triceps muscles:

  22. Add a new shape key, then go to the Gidiosaurus mesh; select some of the vertices in the middle area of the bicep muscle and after enabling the PET again, move them forward and also scale them to be bigger, to make the muscle grow:
    How to do it…

    Making the bicep muscle grow

  23. Rename the shape key bicep.L, and then repeat the steps from 9 to 11 to create the bicep.R shape key.
  24. Add a new shape key and repeat everything by selecting vertices on the back of the arm, in the triceps area, to create the triceps.L and the triceps.R shape keys.
    How to do it…

    Making the triceps muscle grow

  25. Leave the values of these last four shape keys as 0.000 and exit Edit Mode.

    More shape keys could be added to simulate a complete muscle system, but in our case we stop here with the Gidiosaurus mesh; now let's concentrate on the Armor.

  26. Go to the Outliner and unhide both Armor and rig.
  27. Select the rig and then press N to call the Properties 3D view sidepanel; scroll to the bottom and first go to the Rig Main Properties subpanel to set both the slider for FK/IK (hand.ik.L) and (hand.ik.R) to 1.000, then go down to the Rig Layers subpanel and deselect everything except for the Arm.L (IK) and Arm.R (IK) buttons.

    Note

    Note that if the FK/IK sliders don't appear, it's because you have to select one of the hand (ik or fk) bones in the viewport first.

  28. Go to the 3D viewport and select the hand.ik.L and hand.ik.R handle bones, go into the Side view and move them towards the upper back.
    How to do it…

    Moving the arm control bones backward using the Inverse Kinematics

  29. Now press Ctrl + numpad 1 to go in Back view and move the hand.ik.L bone to 0.200 along the global x axis; select the hand.ik.R bone and move it to -0.200:
    How to do it…

    Adjusting the lateral position of the arms

  30. Now select the Armor object and add the Basis shape key in the Shape Keys subpanel under the Object Data window, and then add Key 1.
  31. Enter Edit Mode and press the slash key (/) on the numpad to go in Local view; this way only the selected objects are visible in the viewport, in our case only the Armor. Using the Proportional Editing mode, start to enlarge the back section of the opening for the arms, adjust the position of the surrounding vertices as required, and also raise the back vertices of the spaulders a bit, to avoid interpenetration with the borders of the chest plate and the shoulder as well.
  32. Press the numpad slash (/) key again to go out of the Local view and check for the correction with the Gidiosaurus mesh:
    How to do it…

    Editing the position of the Armor vertices for a new shape key

  33. When you are done, just exit Edit Mode and set the Value slider of the Key 1 shape key for the Armor to 1.000:
    How to do it…

    The shape key working as a fix for the Armor

  34. Rename the Key 1 shape key as Armor_fix and save the file.

How it works…

Although technically there are no differences, we could say that we created three different types of shape key:

  • One type to fix shape errors or make improvements in the mesh, for example, with the prop and the Armor_fix shape keys
  • The second type to modify the mesh only at certain established moments during the animation process, in our case just to animate facial expressions
  • The third type to simulate muscle movements in the character

Shape keys work in linear space; that means that it's not possible to make vertices rotate around a pivot through a shape key, but only to move them from point A to point B. That's why we didn't use shape keys for stuff like the eyelid movements, for example, or the opening/closing of the jaw, but only for actions including muscles sliding above the bones such as the eyebrows, the grin, and the nostrils, as well as the bicep/triceps movements.

Thanks to shape keys, we also made last minute modifications and improvements to the Gidiosaurus mesh and to the Armor; being included inside a shape key, all these modifications are non-destructive and can be turned on or off at will, or their influence can be set at an intermediate strength value.

When modifying a mesh using a shape key, be careful not to change too much of the mutual proportions of articulated parts of a to-be-deformed mesh; for example, it's usually problematic to scale a whole part such as the hands or the head of a character, both smaller or bigger, unless you also scale the corresponding bones of the rig and the joints' position accordingly as well.

Beyond a certain threshold, the bones of the fingers, or of the eyes and jaw, start to be out of register compared to the respective mesh's edge-loops and you'll have to fix this by re-positioning the joints of the Armature's bones (just in case, remember: always do this in Edit Mode).

In our example, with the prop shape key, we just restricted ourselves to enhance the hands' knuckles and to make stronger feet by simply making the vertices' positions grow in the direction of their normals.

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

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