1
00:00:00,000 --> 00:00:03,990
The Aim constraint is another important constraint that we use in

2
00:00:04,000 --> 00:00:04,990
character animation.

3
00:00:05,000 --> 00:00:08,990
And it allows one object to be aimed at another.

4
00:00:09,000 --> 00:00:13,990
You may have encountered the Aim constraint when doing lighting and rendering.

5
00:00:14,000 --> 00:00:20,990
It's used often to aim a light at an object or camera, so that the camera or the

6
00:00:21,000 --> 00:00:23,990
light will follow an object through the scene.

7
00:00:24,000 --> 00:00:28,990
We can also use Aim constraints in character animation to position things such

8
00:00:29,000 --> 00:00:33,990
as the eyes, to make the eyes point at a specific locator.

9
00:00:34,000 --> 00:00:41,990
So in this scene, I have two eyes and a single locator here that we can use as an aim.

10
00:00:42,000 --> 00:00:45,990
So let's take a look at how to set up an Aim constraint for the eyes.

11
00:00:46,000 --> 00:00:51,990
I am going to select my locator first and then Shift+Select eye right.

12
00:00:52,000 --> 00:00:54,990
Remember, the constrained object is always selected last and it should be

13
00:00:55,000 --> 00:00:57,990
highlighted in green.

14
00:00:58,000 --> 00:01:00,990
And then I am going to go over to Constrain > Aim.

15
00:01:01,000 --> 00:01:05,990
Now in these options, we have Maintain offset, which allows you to basically

16
00:01:06,000 --> 00:01:09,990
maintain the initial position of the eye.

17
00:01:10,000 --> 00:01:15,990
We also have the Aim vector, and that is along which axis is this aiming?

18
00:01:16,000 --> 00:01:20,990
Is it aiming along X, Y or Z, or a combination of any of those?

19
00:01:21,000 --> 00:01:24,990
And then also, you know, what is your up vector for the object?

20
00:01:25,000 --> 00:01:29,990
In other words, it's aimed at an object, but also how is it rotated along that axis.

21
00:01:30,000 --> 00:01:34,990
World vectors as well, and then of course, along which axes we want to constrain.

22
00:01:35,000 --> 00:01:40,990
Now in this case, I'm just going to go ahead and click on Maintain offset, and

23
00:01:41,000 --> 00:01:42,990
let's go ahead and add that, so we can see how that works.

24
00:01:43,000 --> 00:01:47,990
And when we do that, basically nothing changes, and the eye just stays in

25
00:01:48,000 --> 00:01:53,990
place and now we can go ahead and move this and you can see how it kind of

26
00:01:54,000 --> 00:01:56,990
moves to match the locator.

27
00:01:57,000 --> 00:02:01,990
But if you notice here because we set maintain offset, it's actually not looking

28
00:02:02,000 --> 00:02:02,990
directly at that locator.

29
00:02:03,000 --> 00:02:06,990
It's looking a little bit to the side.

30
00:02:07,000 --> 00:02:11,990
Now this can be very handy if that's what you want, but let's go ahead and do

31
00:02:12,000 --> 00:02:14,990
this a little bit more precisely.

32
00:02:15,000 --> 00:02:17,990
Let's go ahead and delete this constraint and re-create it.

33
00:02:18,000 --> 00:02:22,990
Probably the easiest way to delete a constraint is to go into the Outliner, find

34
00:02:23,000 --> 00:02:27,990
the object Eye_Rt, which has a constraint, and you will notice that the

35
00:02:28,000 --> 00:02:29,990
constraint is underneath the object.

36
00:02:30,000 --> 00:02:35,990
So all we have to do is select that and hit Delete, and that gets rid of the constraint.

37
00:02:36,000 --> 00:02:39,990
So now when I move this, the object does not constrain.

38
00:02:40,000 --> 00:02:42,990
So let's go ahead and re-create this constraint.

39
00:02:43,000 --> 00:02:47,990
So again, I'm going to select the locator, Shift+Select the eyeball, again, the

40
00:02:48,000 --> 00:02:52,990
constrained object is last, go into Constraint > Aim constraint, and let's go

41
00:02:53,000 --> 00:02:53,990
into our options here.

42
00:02:54,000 --> 00:02:58,990
And in this case, I'm going to turn off Maintain offset, and just leave

43
00:02:59,000 --> 00:02:59,990
everything else at the default.

44
00:03:00,000 --> 00:03:02,990
And let's go ahead and hit Add.

45
00:03:03,000 --> 00:03:07,990
And as you can see, the eye jumps a little bit to its right.

46
00:03:08,000 --> 00:03:12,990
Now the reason it's doing that is because right now we are aiming along the

47
00:03:13,000 --> 00:03:15,990
default axis, which is the X axis.

48
00:03:16,000 --> 00:03:20,990
Now we can change that in that Aim constraint option here.

49
00:03:21,000 --> 00:03:28,990
We have the Aim vector is right now 1 along X, 0 along Y and Z, but if we want

50
00:03:29,000 --> 00:03:31,990
to change it later, we can always go into the Attribute Editor.

51
00:03:32,000 --> 00:03:35,990
So I'm going to make sure my eye is selected, go into the Attribute Editor, and

52
00:03:36,000 --> 00:03:39,990
find the Eye_Rt_aimConstraint.

53
00:03:40,000 --> 00:03:42,990
Then all we have to do is find that Aim vector.

54
00:03:43,000 --> 00:03:48,990
In this case, you can see the red axis, or the X axis, is pointing towards that locator.

55
00:03:49,000 --> 00:03:53,990
We want the blue axis or the Z axis to point.

56
00:03:54,000 --> 00:03:58,990
So let's go ahead and 0 out the X axis, and notice how that already snaps.

57
00:03:59,000 --> 00:04:05,990
And then let's go ahead and make it 1 along Z. So now that I have this, you can

58
00:04:06,000 --> 00:04:09,990
see it's pointing towards that locator a lot more precisely.

59
00:04:10,000 --> 00:04:13,990
And usually, this is the way that we want to set these things up.

60
00:04:14,000 --> 00:04:17,990
So now that we know exactly how to set it up, let's go ahead and set it up

61
00:04:18,000 --> 00:04:18,990
for the second eye.

62
00:04:19,000 --> 00:04:23,990
So I'm going to click on this eye here and you can see that the blue axis again

63
00:04:24,000 --> 00:04:28,990
is the axis we want, so I'm going to select my locator, Shift+Select Eye_Lt, go

64
00:04:29,000 --> 00:04:34,990
into Constrain > Aim constraint, and in this case I don't want this to be

65
00:04:35,000 --> 00:04:42,990
constrained to X, I want it to be constrained to Y, hit Add, and there we go.

66
00:04:43,000 --> 00:04:48,990
So now, I can select my locator and the eyes will follow.

67
00:04:49,000 --> 00:04:52,990
So obviously, this guy is a little bit cross-eyed, but we can certainly do

68
00:04:53,000 --> 00:04:56,990
multiple locators if we want, and we'll get into that a little bit more

69
00:04:57,000 --> 00:04:59,990
precisely, in the later chapters.

70
00:05:00,000 --> 00:05:04,990
But as you can see, the Aim constraint can be used to point up one object at

71
00:05:05,000 --> 00:06:05,990
another, and there is a number of ways to use this in character rigging.


