Often, it is very useful to put movement limitations on the bones of a rig, for several reasons—usually, to make them easier to work with, but also to establish a maximum range for the rotation of the limbs or other parts like in the mandible or the eyelids.
Two types of limits for the bones are: by the Transform locks, and by bone constraints.
Getting ready
Load the Gidiosaurus_shapekeys.blend file, select the Armature, and go in Pose Mode.
How to do it…
Let's start with the Transform locks:
Select the eyebrow.L bone and if not already present, press the N key to call the 3D viewport Properties sidepanel. Go to the Transform subpanel, which is the first entry at the top, or also to the Transform Locks subpanel under the Bone window in the main Properties panel to the right of the screen:
The Transform subpanel in the N Properties sidepanel and the corresponding Transform Locks subpanel under the main Properties panel
Click on the lock icon to the right side of the properties; for this bone (which, if you recall, is the driver control object for the left up and down eyebrow shape keys), we want to lock all the possible transformations except for the movement on its y axis, so the Location Y lock button is the only one that should remain untouched:
Setting the axis Transform locks for the Location, Rotation, and Scale
If you now try to move the eyebrow.L bone, you will notice its movement is constrained only to its local y axis; the movement is directed by the Roll orientation of the bone in Edit Mode (and not by the Normal item enabled in the Transform Orientation button on the viewport toolbar); enable the Axes item in the Display subpanel under the Object Data window to see this.
Having locked the other two axes, it's no longer necessary to use the widget arrow to move the bone on its local y axis but it's enough to simply press the G key and then move the mouse instead.
And now, let's see limits by constraints.
Go to the Bone Constraints window and assign a Limit Location constraint to the eyebrow.L bone.
Check the Minimum X and Maximum X, Minimum Y, and Maximum Y, and Minimum Z and Maximum Z items. Leave the values for the x and z axes as they are, change Minimum Y to negative -0.050, and change Maximum Y to positive 0.050 (again, remember that these values are valid just for this file).
In the Convert slot, change the Owner Space item to Local Space:
The assigned Limit Location constraint subpanel under the main Properties panel
In Chapter 1, Modeling the Character's Base Mesh, we enabled the Copy Attributes Menu add-on in User Preferences and then we saved the User Settings, so I'm taking for granted that you have the script still enabled.
Therefore, we do the following:
Select the eyebrow.R bone and then Shift-select the eyebrow.L bone. Press Ctrl + C and from the Copy Attributes pop-up menu, select the Copy Bone Constraints item.
Select the grin.L and grin.R bones and then Shift-select the eyebrow.L bone. Once again, press Ctrl + C | Copy Bone Constraints, and in the two copied constraints, set the Minimum Y value to 0.000.
Select the nostril.L and .R bones and Shift-select the grin.L bone, then press Ctrl + C | Copy Bone Constraints. This time, set both the Y values to 0.000 and Minimum X for the nostril.L bone to negative -0.050 and the Maximum X for the nostril.R bone to positive 0.050.
Save the file.
Several other movement constraints have been added to different bones in the rig, for example the jaw bone, or the eyelid controllers, but especially to the eye bones, to limit the range of possible rotations. To have a look at the various settings, just open the Gidiosaurus_limits.blend file.