Tutorial 11 – Maya Constraint RECAP


-Maya Constraint RECAP –

This is a more technical topic so I think is important to make a written RECAP of my last Turorial about the Maya Constraint:

Here the VIDEO tutorial

indexw

-RECAP-

I want to show you how to create a parent constraint and how to plan the method to use based on the type of action you have

There’s a lot of different ways to constrain an object to an other and I’ll show you some of the more common situations using the maya constraintSchermata 2018-01-25 a 00.21.09.png

It’s basically a relationship between two ore more objects, one is the TARGET Object, the one that leads the movement or the position, and the other is the CONSTRAINED object, that is influenced by the target, so it doesn’t moves independently but it’s driven by the target objectSchermata 2018-01-25 a 00.21.23.png


Schermata 2018-01-25 a 00.21.31.png

The type of constraint depends on the axes you need to constrain to the lead object: translation, rotation or scaleSchermata 2018-01-25 a 00.21.38.png

In Maya, if you go in the Animation Tab

Schermata 2018-01-25 a 00.21.46.png

and then on CONSTRAIN

Schermata 2018-01-25 a 00.21.51.png

you find some different types of constraints: POINT – AIM – ORIENT – SCALE – PARENT

the more used are POINT / ORIENT and PARENT

Schermata 2018-01-25 a 00.21.55.png

As I said before the difference between this constraints are the axes involved:Schermata 2018-01-25 a 00.22.04.png

So if you constrain an object with the POINT constraint you will constrain the translation axis that will follow the lead object but you can rotate it independently

Vice versa: if you use the ORIENT constraint you can translate it but the rotation is constrained to the lead object

And when you use the PARENT constraint both the axis (translation and rotation) are constrained and follow the lead object movements


-CONSTRAINT OPTION PANEL-

When you open the constraint Option Panel you have the first box “Maintain Offset” that means that if you turn it ON: the object will be constrained maintaining his starting position, if you turn it OFF: when you will apply the constraint, the object will jumps on the target object pivotSchermata 2018-01-25 a 00.22.22.png

In most of the cases you will need to turn it ON, so…always check this option before apply the constraint!


Another thing you can check are the Constraint Axes: here you can choose which axis you want to constrainSchermata 2018-01-25 a 00.22.45

In the example we have the translation and rotation axes cause it’s a parent constraint

By default you have ALL the axes turned ON but you can turn off the ones you don’t need!


When you apply the constraint you will see that the axes constrained turned blue in the channel box, this means that you can’t animate this valuesSchermata 2018-01-25 a 00.23.00.png


Let’s now see the different situations where you’ll need to constraint some objects

This are the different situations we will go to analyze: Schermata 2018-01-25 a 00.23.08.png

This are some common situations and it’s important that, before you go to start the animation and create the constraints, you have to plan the shot!

Schermata 2018-01-25 a 00.23.22.png

Do it in your mind or with some sketches, because is important to decide how to do the constraint and you need to anticipate all the actions you will do with the constrained object!


Let’s start with the first situationSchermata 2018-01-25 a 00.23.24.png

 


-Hands on Hip-

In this simple animation the character keeps his hands on his hip, so we need to constrain the hands to the hip in order to follow the hip movements, so… the hip will be the leading object that will drive the hands

Schermata 2018-01-25 a 00.23.28.png

In some rigs you could have the possibility to choose if the hands must follow the hip or other parts of the body (the Main control, the COG, the Head…) without manually create a constraint! Usually if this option is available, you can find it selecting the wrist control!Schermata 2018-01-25 a 00.23.31.pngBut in case you have a very basic rig, without this option, let’s see how to manage it!

IMPORTANT: when we constrain the hands, this must be in IK mode, so switch both the hands in IK!Schermata 2018-01-25 a 00.23.55

So we pose the hands on the hip, then…

REMEMBER THAT: to apply the constraint you always have to select the target control first, the one that will leads the movement and then the control or object you want to constrain!Schermata 2018-01-25 a 00.24.07.png

So in this case: select the hip control, then -> shift -> and select the control of one of the hand, go in the Animation tab -> CONSTRAIN and choose PARENT

Schermata 2018-01-25 a 00.25.07.png

we choose parent ’cause we want that the hands follow the hip in both translation and rotation axes!

Open the Option Panel, be sure to have the MAINTAIN OFFSET turned ON and apply it!Schermata 2018-01-25 a 00.25.15.png

So the translation and rotation axes turned blue in the channel box and now this hand is constrained to the hip, let’s do the same on the other one!

Schermata 2018-01-25 a 00.25.42.png

At one point he detaches the hands from the hip so we need to turn OFF the constraints in order to animate the hands!

To do that we simply select the hands controls, one at the time and we set a key

 

When you do this in the channel box you can see that the constrained axes turned green and you have a new attribute, the BLEND PARENT Attribute that you can animate! (scroll down in the channel box to see it)

Schermata 2018-01-25 a 00.25.48.png

So on the last key frame where you still need the constraint, set this attribute at 1 and add a keySchermata 2018-01-25 a 00.25.59.png

in the following frame where you want to turn OFF the constraint set it at 0 and add another key, so from this point you can animate the hands!
Schermata 2018-01-25 a 00.25.53 copia.png

036.png


-Hand on another character’s shoulder-

An other similar example is a character that puts his hand on the shoulder of another characterSchermata 2018-01-25 a 00.26.20.png

In this case you do the same, you constrain the hand on the shoulder control, so select the shoulder ctrl first, then the wrist ctrl and apply a Parent constraint (Maintaining the Offset)!Schermata 2018-01-25 a 00.26.28.png

Then you animate the blend parent before he touches him, turning the constraint OFF and when he touches the shoulder you set it at 1 turn it ON!

Schermata 2018-01-25 a 00.26.42.png

In this way, if you animate the other character, the hand follows the second character movements


-Two Characters holding their hands-Schermata 2018-01-25 a 00.26.47.png

First pose the two hands, then choose the leading hand (this hand can be in IK or FK) and constrain the other hand to this one (the constrained hand must be in IK) and choose a Parent constraint!

Schermata 2018-01-25 a 00.26.52.png


An other situation…Schermata 2018-01-25 a 00.26.59.png

Let’s say your character need to grab an object, like this ball, he takes it with an hand (in this case you can us IK or FK) and then he throws it!

So the ball will be driven by the character but at one point it will moves independently

In this simple case, you could just constrain the ball geometry, it’s not necessary to have a locator or a rig for the ball, ’cause the animation is pretty easy. But if you have to do more complex actions with the ball I suggest you to use a locator or a rigged ball so that you could also have a squash and stretch!

Schermata 2018-01-25 a 00.27.26.png

So in this example I just constrain the geometry to the hand, as I show in the previous example, I pose the ball in the starting pose, then I pose the hand at the point where it grabs the ballSchermata 2018-01-25 a 00.27.43.png

Select the hand control -> shift -> and select the ball geometry and choose Parent constraint (Maintaining the Offeset)

Schermata 2018-01-25 a 00.27.51.png

To switch On and Off the constraint, select the ball geo (or the group, locator or control you constrained) and add a key, set at 1 the blend parent attribute on the frame where the hand touches the ballSchermata 2018-01-25 a 00.27.54.png

in the previous frame set it at 0, so the ball stays in the starting position!Schermata 2018-01-25 a 00.28.01.png

When you need to detached the ball from the hand, go on the last frame where the ball must be constrained to the hand and set at 1 the blend parent, in the following frame set it at 0 and animate the ball!Schermata 2018-01-25 a 00.28.17.png

SECOND OPTION: To have more control and have the possibility to add a secondary movements on the ball, you can create a group for the ball so that you can constrain the group to the hand and animate the ball geometry indipendently!Schermata 2018-01-25 a 00.28.29

So we do just as in the previous example but we don’t go to constrain the geometry, but we constrain the group

Open the OUTLINER, select the ball geometry and press G, so you go to create a group and you go to constrain this group to the hand, so select the hand ctrl then the group of the ball and apply a Parent constraint mantaining the offset!

So now the ball follows the hand but you can select the ball geometry (that has no constraint and is free to move) to add further movements! When you want to turn ON and OFF the constraint just do as we have seen so far!Schermata 2018-01-25 a 00.28.36.png


Let’s change the type of prop, let’s say he grabs a bottle

Schermata 2018-01-25 a 00.28.53.png

If you create a group from the bottle geometry and you go to constrain the group to the hand, you can still select the bottle geometry to add some overlap!

Schermata 2018-01-25 a 00.28.59.png

In this case I also need to move the pivot of the bottle geometry, that now is in the center and I wanted to move it on the top, where the hand grabs it! So to edit the pivot position just select the mesh and pressing D you move it where you want!

Now the bottle is driven by the hand (cause the bottle group is constrained) but we can animate the geometry to add an overlap!

If you have a rig on your prop, you can do the same: create a group that you will constrain to the hand and then you animate the prop control for the overlap!

 


Third situationSchermata 2018-01-25 a 00.29.54.png

There’s some situation where you will need to constrain the character to an object


-Character on a Swing-Schermata 2018-01-25 a 00.30.18.png

For example: a character on a swing, obviously this is not a common thing you’ll have to animate, but it’s just to give you an example of situation where your character is driven by something!

You pose your character on the seat, both the arms are in IK, the legs must be in FK, and you constrain the COG of the character to the seat, so that when you move the swing the body follows the movements, except for the hands that are in IK!

Schermata 2018-01-25 a 00.30.58.png

So now we need to constrain the hands to the swing’s ropes, to do that we need to create 2 locators!

So we go to CREATE -> LOCATOR

Schermata 2018-01-25 a 00.31.16.pngSchermata 2018-01-25 a 00.31.20.png

We turn ON the locator visibility from the SHOW panelSchermata 2018-01-25 a 00.31.24.png

We move the locator on the first rope, where we have one of the hands and then with ctrl D we duplicate this locator and we move the second one on the other side

Schermata 2018-01-25 a 00.31.28.pngSchermata 2018-01-25 a 00.31.32.png

Then, select one rope -> shift -> the first locator and create a Parent constraint, and do the same for the other locator!

Schermata 2018-01-25 a 00.31.40.png

Or, another way is to just PARENT the locators to the ropes, so we don’t create a constraint but we create a permant relashionship parent/child between the rope (parent) and the locator (child), to do that: select the locator -> shift -> the rope and press P, and do the same with the other locator and rope!


Let’s quickly see the…

-Difference between PARENT CONSTRAINT and PARENT-

  • The PARENT CONSTRAINT is (what we have seen so far) an animatable relationship between 2 (or more) objects that you can control and animate. It can be turn OFF and ON depending on your needs and can be apply on some axes that you can choose between: translation rotation or scale! To create a constraint we select the leading object, then the constrained object, and we apply a Constraint (choosing between POINT, ORIENT or PARENT)

 

  • PARENT is a permanent relationship between a parent and a child that doesn’t changes! The child is subordinate to the parent, no matter what! You can still animate the child independently, but any time you translate, scale or rotate the parent…the child will follows. To parent an object to another, we select the child object first, then the parent object and we press P, in the outliner you’ll see that now you have a hierarchy where the first object selected is child of the second object

Schermata 2018-01-25 a 00.31.59.png

In this case the result is the same, so you can choose one of this two options and in both the cases the locators will follow the ropes movements! The only difference would be if you need to change position of the hands on the rope during the animation, in this case is better to choose to just PARENT the locators to the rope, so that you can use the locators (the are not constrained) to animate the hands!

So now the 2 locators follow the swing movements, but we still need to constrained the hands, so we select one locator then the hand control and create a parent constraint and do the same for the other hand!

Schermata 2018-01-25 a 00.32.09.png


Or, if the character is trying to lift an heavy object without success… so the object will stays on the ground…Schermata 2018-01-25 a 00.32.23.png

would be easier for you to constraint the hands on the object

So we create 2 locators, that we keep in on the origin, so we don’t move them, then selecting the 2 locators we create a group pressing G

Schermata 2018-01-25 a 00.32.37.png

and we constrain this group to the object, so we select the object and then the locators group and we create a PARENT constraint, so now the locators group is constrained to the object

Schermata 2018-01-25 a 00.32.41.png

Now we need to position the locators where we have the hands, to quickly do that we create a temporary constraint!

We go on the frame where the hands touch the object, we select the hand control then one of the locatorSchermata 2018-01-25 a 00.33.17.png

and we create a parent constraint but this time we UNCHECK the MAINTAIN OFFSET, so the locator jumps on the wrist pivot (this is a very quick way to position an object on the pivot of another object) Schermata 2018-01-25 a 00.33.29.png

and now we can delete this constraint from the locator, in the channel box we select the constrained axes and -> right-click -> BREAK CONNECTIONSSchermata 2018-01-25 a 00.33.42.png

Then we constrain the hand control to the locator, so select the locator and then the wrist control and create another parent constraint!

Schermata 2018-01-25 a 00.34.10.png

From this point you can forget the hand control and use the locator to animate the hand! Do the same for the other locator to pose it on the wrist pivot and then constrain the hand to the locator

In this way when you animate the object, that leads the movement, the hands follow but you can also add some further movements for the hands by using the locators that are free to move ’cause we just constrained the group of the locators!


Fourth situation…Schermata 2018-01-25 a 00.34.38.png

This is also something very common and I’m going to show you 2 different options for this

The first and faster way is to pose both the hands on the object, constrain the object to one of the hand (the hand you chose as the leading hand, the one that controls the movement) and constrain the other hand to the object, so when you’ll move the leading hand, both the object and the other hand will follow

Schermata 2018-01-25 a 00.35.18.png

REMEMBER THAT: the leading hand can be in IK or FK, but the constrained hand must be in IK!


But if you want something more complex, for example if you want to change the positions of the hand while grabbing the object you have to do something similar to what we have done in the example of the heavy object

Creating 2 locators, PARENT the object to one of this locator, so we select the object and the first locator and we press P, and PARENT the second locator to the objectSchermata 2018-01-25 a 00.35.45.png

Selecting the parent locator we move the object in position, and then we constrain the parent locator to the leading hand control, (the leading hand can be in FK or IK, but the other hand, that we will be constrained to the object must be in IK)

So we select the leading hand control then the parent locator and we create a parent constrain maintaining the offsetSchermata 2018-01-25 a 00.36.32.png

Now we need to position the second locator on the other hand pivot, so we select the  hand control -> then the second locator and we create a parent (or point) constrain (DESELECTING the maintain offset), so the locator moves on the wrist pivot, and now we delate this constraint!Schermata 2018-01-25 a 00.36.40.png

Then we select again the locator -> then the left hand control and we do parent constraint again!Schermata 2018-01-25 a 00.36.54.png

So now you can use the right arm to lead the movement, the object and the left arm follow, but using the left locator you can add further movements for the left hand and change position during the animation!


The last situation…Schermata 2018-01-25 a 00.37.09.png

In this case, when you plan to grab the same object with both the hands in different times, it means that the object must be constrained to one hand first and then on the other hand in a second time!

To do that: first let’s set up 2 locators on the object

So we create 2 locators that we rename left and right handSchermata 2018-01-25 a 00.37.34.png

then we need to PARENT the locators and the object . At this point we should plan which hand holds the object first and based on that we create this parent hierarchy:

  1. select the locator of the second hand that will holds the object -> then select the locator of the first hand and press P (so now the left hand locator, that is the second hand that holds the object, is child of the locator of the right hand)
  2. now select the object and the left hand locator and press P (now the object is child of the left hand locator)

So if we move the right hand locator we move everything but if we select the left hand locator we move just he object while the right hand locator stays in position

054c.png

Now, selecting the parent locator, the right hand locator, we position the object in the right hand (that holds the object first), and then we constraint the parent locator to the right hand control, so we select the hand control -> shift -> the locator and we create a PARENT constrain Maintaining the offset!

Now we can move the arm and the object follows!

Schermata 2018-01-25 a 00.38.23.png

When we want to switch the hands, we move on the frame where the object is grabbed by the left hand and we select the left hand control -> shift -> the left hand locator and we create the PARENT constraint Maintaining the offset

Schermata 2018-01-25 a 00.39.16.png

then we add a key and we set at 1 the blend parent on this frame but we set it at 0 on the previous frame

Schermata 2018-01-25 a 00.39.25.png


Sometimes can happen, for different reasons, that you don’t see the Blend Parent attribute in the channel boxSchermata 2018-01-25 a 00.39.35.png

if this happens you can just select the Constraint Node from the Outliner, select the object and in the outliner press F to find the constraint node (the one with the red exclamation mask) Schermata 2018-01-25 a 00.39.44.png

and animate the Weight Value, set it at 1 or 0 to manage the influence of the constraint on the locator!Schermata 2018-01-25 a 00.39.49.png

So now you can pass the object from an hand to another just turning on and off the constrain on the left hand locator!


A similar situation is when the character passes an object, like an hat, from an hand to another and then he puts it on the headSchermata 2018-01-25 a 00.40.03.png

In this case the process is the same but we need to add a third locator, that is the one that will be constrained to the head in the final part

So we start setting the locators on the hat, we create 3 locators, that we rename as the body parts they will be constrained to

Schermata 2018-01-25 a 00.40.18.png

and we go to PARENT this locators and the hat with this hierarchy:

  1. we select the right hand locator then the left hand locator and press P
  2. select the head locator and the right hand locator and press P
  3. and last, select the hat geometry then the head locator and press P

Schermata 2018-01-25 a 00.40.34

So now selecting the parent locator, we position the hat in the left hand and we create a parent constraint (Maintaining the offset) with the hand control

Then we do as in the previous example, we animate the constraint blend parent On and OFF when we switch the hands and we constrain the right hand to the other locatorand the same when the hat is on the head, so that in the final part the hat is constrained to the head and follow the head movements!


This were just some examples of how to manage constraints on maya, there are a lot of different way to do them, it’s really depends on what you need in your scene and it also change depending on the type of rig you have

There are also scripts and tools to automatically create constraints, especially in production, but if you are beginners this should be enough to start to manage props in you animations

Schermata 2018-01-25 a 00.41.05.pngSchermata 2018-01-25 a 00.41.17.png


Schermata 2018-01-25 a 00.41.26.png

When you want to delate a constraint you can select the constrained control (or group or mesh) and in the channel box select all the attribute constrained and right-click BREAK CONNECTIONS

Schermata 2018-01-25 a 00.41.39.png

Or… select the object constrained, press F in the outliner to find the constraint node and… delate it!

Schermata 2018-01-25 a 00.39.44


-BAKE CURVES-

Or, if you want to take off the constraint but you want to keep the animation… you can BAKE the curve

selecting the object constrained and, in the graph editor, click in CURVES – BAKE CHANNEL

Schermata 2018-01-25 a 00.41.57.png

so it will converts the the entire animation in keyframesSchermata 2018-01-25 a 00.42.00.png

and now you can delate the constrain, as I showed before, without losing the animation!


In the last lesson I explained the principle of Secondary Actions and props are a good way to add this actionsLesson010_Secondary_Action2.png

So now you know how to manage the constraints and you can create an animation with a secondary action following this exercise to put in practice this principle! 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s