Parent / Child

What do we mean by parenting? Think of it as a leader and a follower, where the leader moves the follower will move as well, the follower is still able to move indepentently but will always follow the leader. The parent is the leader and the child is the follower. The most basic way to create a parent child relationship is to create a hierarchy where the object at the top is the parent and the object below is the child. To create this select the object you want to be the child first then SHIFT select the object you want to be the parent and press the 'P' key. So the sequence is child, parent and P. In the images below the sphere is the child of the cube, look in the outliner and you will see the hierarchy which has been created. It is important to remember the sphere can still be moved and it won't effect the cube however as soon as the cube is moved the sphere will also move.

A parent can have more than one child, this works in the same sequence as the first example select all the objects to be the children and the select the parent object and press the 'P' key. When you are selecting objects the last object selected will be highlighted in green which will be the parent and all the children will be highlighted in white

The idea of parenting can be pushed further as a parent can also be a child of another parent. To simplify it a child will follow its parents and the parents will follow its parents and so on.

To demonstrate this idea lets create a rudimentary solar system. In this solar system Earth and the Mars will rotate around the Sun and the Moon will rotate around the Earth. So the Earth and Mars will be children of the Sun and the Moon will be a child of Earth. Select Earth and Mars and then select the Sun and press the 'P' key. Earth and Mars are now children of the Sun, now select the Moon and select the Earth and press the 'P' key. Look in the outliner the Sun is at the top of the hierarchy, but the Earth is also at the top of its own hierarchy which includes the Moon. If the Sun is rotated Earth and Mars will rotate along with it. The Moon will also rotate along with the Sun as it is still a child of the Earth which is a child of the Sun. If the Earth is rotated the Moon will rotate around it but still maintaining its rotation around the Sun.

There are other ways of parenting objects in Maya, in the outliner select an object and MMB drag the object over the object you want to make the parent, a white dotted box will outline the object, if you let go of the MMB the object will become a child of the object (a dotted white line between objects will only move the object in the outliner). Another way is to select the child/children and then select the parent and go to the Edit menu and select the Parent option near the bottom of the list. In the Edit menu you might have noticed the option to Unparent, to unparent an object select only the child and go to the Edit menu and select Unparent or press 'Shift & P'

NOTE: When an you parent an object, the child won't receive any of the translations, rotations or scale values from the parent. If you look in the Channel Box, the childs values won't change as you change the parent


Constraints

Constraints are similar to parenting objects but with some key differences. The best way to describe these are like a master and a slave, what ever the master does the slave will do the exact same. In normal parenting the child can move freely but still follow the parent, in a constraint the child will follow exactly as the parent does. The five main types of constraint are Parent, Point, Orient, Scale and Aim, these can be found in the Constraint menu at the top of the list.

NOTE: When you constrain an object, the child will copy translation, rotation or scale values from the parent to the child (depending on the constraint type)

Parent Constraint: The parent constraint should be the easiest to understand as it has the most in common with normal parenting. A parent constraint constrains an object in both translation and orientation. The big difference is that if the child is moved around the scene as soon as the parent is moved it will snap back in place with the original position of the constraint. A constrained object doesn't get placed inside a hierarchy, instead it receives a parentConstrain which you can see inside the outliner. 

Point Constraint: The point constraint will give the child the same translation values as the parent but not rotation and scale values. A child of a point constraint will snap to the position of the parent but will maintain its own rotation and scale values. Like the parent constraint the child can be moved but as soon as the parent is moved it will snap back into place. Like the parent the child receives a pointConstraint node which can be seen in the outliner. 

Orient Constraint: The orient constraint works in a similar manner to the point constraint but only constrains the child rotation values. Unlike normal parenting the child rotates around its own axis not the parents. 

Scale Constraint: The scale constraint works in a similar manner again, but only constrains the scale values of the child. Again like the orientation constraint the child will scale from its own pivot point not the pivot point of the parent.

Aim Constraint: The aim constraint works a little differently to the rest rest, it constrains an axis of there child to follow the position of the parent. So if the X axis of the child is constrained to the parent it will follow the parent around the scene but won't move only rotate. This is most commonly used for eyes.

NOTE: When constraints are placed on a child, the constrained values are coloured blue in the Channel Box this means that it is connected to a parent which controls these values. You can change the values but they will snap back as soon as the parents are changed.

So whats the point of all these constraints? The point constraint can seem useless except for maybe snapping an object into place. But the power of these constraints come into play when you animate the child. If keyframes are set on the child's constrained values it will turn off the constraint, but importantly it also creates an extra attribute at the bottom of the Channel Box called Blend Point 1 if this attribute is changed from 0-1 it changes how much of an effect the point constraint has on the child.

NOTE: When values have more than one influence effecting them the value is coloured green.