Parenting and Constraining for Animators
Category: Character Animation | Content Rating: Animator
If you are an animator, you need to know the differences and similitudes between parenting and constraining. In this post, I am going to explain how those systems work in Maya and how to take advantage of the best of each to improve our animation workflow. Notice that both techniques are not only crucial for animators, but also for other 3D professionals like riggers or modelers. I´m going to use Maya for illustration purposes only, but all the concepts we are going to discuss here, can be applied to any other 3D package, such as 3dsMax or Blender. With that said, let´s begin with the definition of parenting.
I. The Parenting System
A Static Relationship
Before jumping into what we are interesting in, let me give you a couple of real life examples to better illustrate what parenting means. Look at the following sentence:
When Bob goes to school, his little brother John goes with him.
According to the propositional logic, we can conclude that every time Bob goes to school he needs to bring his brother with him, but it doesn’t mean that the younger kid could not do it by himself. A 3D visualization of this example suggests that the position (XYZ axis) of John depends on the position of Bob. This type of hierarchy is similar to the parenting system we are going to talk in this post. To give a better idea of it, let´s look at a very good example from the book How to Cheat in Maya (Luhta and Roy, 2012, pp. 120). In this book, they use the relationship between earth and us to explain what parenting means. When we are sleeping, we may think we are not moving, and that´s not wrong depending on the universe we are considering. The fact is that in relation to the earth we are constantly moving, because of its translation and rotation movements. So, in this case, we are parented to the earth just as one object can be parented to another in Maya´s 3D space (the earth is called the parent object and anyone of us, the child).
Now, let´s technically define parenting. A parenting relationship between two objects indicates that the child object has the same central universe of the parent. Let´s explain this. When we create a new object in Maya, its central universe is the origin of coordinates of the 3D space. It means that if we move the object around and zero out its translation values it is going to come back to the center of the viewport (Tx = 0, Ty = 0, Tz = 0). In other hand, if we parent an object to another and do the same, it will return to the center of the parent object, not to the origin.
II. Constraint´s Types in Maya
A Dynamic Relationship
Before getting any further, let´s first talk about parent constraining and explain the main differences between it and the parenting system. To illustrate it, we can look at a variation of the first example of parenting. Imagine now, the following situation:
Instead of taking his brother with him to some place, Bob gives to his brother the address and meets him there.
It is very similar to the other example because both brothers have the same position too. What makes the difference is the way that Bob communicates to John where he is.
So, technically, when we constrain parent one object to another, the constrained object receives the translate, rotate and sometimes the scale data (in some 3D packages) of the master object, and updates its corresponding values. To do it in Maya we must go to Animation Menu > Constrain > Parent. There are still other differences between parenting two objects and parent constraining them, but before jumping into that I´d like to explain the other constraint types available in Maya.
In some cases, we don’t want to constrain the translation and the rotation of our objects. For example, if we need to make our character rotate a crank, we must only get the position of the master object transferred to the hand of the character. That way, the hand can follows the handle of the crank but still have its rotation values animated separately. To do it in Maya go to the Animation Menu > Constrain > Point.
Similar to the Point Constraint, the orient constraint just transfer the rotation of one object to another. We can use this constraint type to animate two characters walking independently but looking at the same objective. To do it, go to Animation Menu > Constrain > Orient.
To constrain only the scale values, we must use the Scale Constraint (Animation Menu > Constrain > Scale). Notice that by default the parent constraint doesn’t do this, so we must do a Parent Constraint and a Scale Constraint to transfer all attributes from the master object to the constrained one.
This type of constraint works a little bit different. We must use this one when we want to make an object to aim to the direction of a target object. It´s useful for controlling the eyeballs of a character or for making a camera face to somewhere. To use this feature, go to Animation Menu > Constrain > Aim. If you want to know more about this type of constraint, reference the Maya´s Documentation.
Other Types of Constraints
There are others constraint´s types in Maya, but I will not talk about them in this post because they don’t have the same importance for animators as the ones described before. Just for you to know, Maya allows you to constrain by geometry, normal and tangent. There is also other type of constraint called Pole Vector, which is used a lot in rigging to control the orientation of an IK Handle. They can be found at the same place of the other types (Animation Menu > Constrain). For more information, visit Autodesk Maya´s Website.
III. Parenting vs. Parent Constraining
A Comparison List
Parenting and constraining are even more powerful when used together. But before combining both technics, you first need to understand them. Knowing the pros and cons of each method will give you the chance to decide which one to use in each situation. So, take a look at the comparison list below:
- The child object references the central universe of the parent one (Image 3). If we zero out the values of the child object the child goes to its parent origin (Image 5).
- The relationship between the parent and the child is static. It can´t be turned off over the course.
- This system modifies the structure of the objects in the Outline (Maya´s hierarchy). You can see that by comparing the images 2 and 4. After parenting the child object must be under the parent object.
- The child can still be moved and keyed independently (Image 7).
- To do it in Maya, you need to select the child object first, then the parent, and hit “P”.
- The phrase: “take the child to its parent” will help you to remember in which order you need to select the objects.
- To unparent them, you just need to hit “Shift + P”.
- The constrained object still references its positions from the origin. It receives the translate and rotate values by the master object.
- By default, when we parent constrain an object to another, Maya doesn’t constrain its scale values, just transfer the rotation and the position from the master to the constrained object. We can see in the images 13 and 14 how the scale values were not keyed.
- The relationship between the master and the constrained object is dynamic. It can be switch on/off over the course. When it is on, the constrained object can´t neither be moved nor keyed independently (attributes locked), but if it is off, the system ignores the constrain and let us move and key the object.
- The system doesn’t modify the structure of the objects in the outline, just create a parent constrain node below the constrained object (Image 12).
- To constrain parent one object to another in Maya, select first the master object, then the object to be constrained (Image 8) and go to Menu Animation > Constrains > Constrain Parent (Image 10).
- To undo, you can break the connections or delete the constrain parent node.
- Remember to select first the object who needs to tell its values (master object).
IV. Animating characters and Props
Using locators and grouping
Constraining a prop to a character (or vice versa) is a very common situation all animators have to deal with. The nice thing about animating props is that you can do it by so many ways. In fact, the objective of this post is not to discuss my workflow, but to show you how to take advantage of both parenting and constraining methods.
Let´s suppose we have a character carrying a ball. Notice if you constrain the ball directly to the character hand´s control it will do the job, but you will lose flexibility for future animations. The reason for not to do so, is that you cannot move the ball after that because the ball´s position is locked by the constraint´s node. A better approach is to use an empty object as an intermediary between the hand and the ball to combine the best of parenting and constraining technics. That way we get the same functionality but we can still key the ball independently. The objects we are going to use for this purpose are the locator and the empty group.
- So first, create a locator and name it loc_ballControl (Image 16).
- With the locator still selected, press Ctrl+G to create a new group and name the group grp_loc_ballControl (Image 17).
- Notice, the locator is now parented to the group (Image 18).
- Now, select the locator, shift select the ball and do a Parent Constraint and a Scale Constraint.
- Remember to not activate maintain offset to match the ball´s and the locator´s positions.
- After that, select the right hand control, shift select the locator´s parent group and do a Orient Constraint and a Point Constraint. This process depends on the setup of your rig. In my particular case, I have a box curve to control the IK systems of the arm and a circle curve just to control the wrist orientation. So, I need actually to orient constrain to the wrist control (Image 19 and 20) and point constrain to the IK arm control (Images 21).
Now, we have both parenting and constraining systems and we can key the locator without messing up the constraint´s values. By having a IK system setup like showing above we can easily animate our character throwing a ball by moving the IK arm control (Image 22).
Always that I need to work with constrains I use to plain it first, before going to Maya. Planning your constraints can help you to understand the hierarchy you need to create.
V. Constraint´s Weight
Switching constrains on and off
Imagine that instead of carrying a ball, we want our character to pick up it from a table. In this case, we must use the same approach of the example from above, but we will need to switch on/off the constraint´s weight over the course. Actually, the weight must be 0 when the animation starts (ball over the table), and 1 when the hand of the character touches the ball. In the parent´s node of the locator´s group, you are going to find one channel called Wn (n=0, n=1 …). It is a keyable attribute for controlling the weight.
The process is the same for passing an object from a character to another, except for the fact that the prop must be constrained to both characters. We need to enable the constraint for the character that has the object and disable it for the other one. In the moment one character gives the object to the other, we just need to switch the values. It´s important to notice that the Wn is a float attribute. So, if we want, we can blend between these values if we want the character to throw the object to the other.