WEBVTT

1
00:00:00.001 --> 00:00:05.000
Constraints are valuable tools used in the process of rigging.

2
00:00:05.000 --> 00:00:11.000
They allow for simple and complex relationships to be formed between bones and between objects.

3
00:00:11.000 --> 00:00:17.000
There are two main types of constraints, object constraints and bone constraints.

4
00:00:17.000 --> 00:00:23.000
For the most part, bone constraints are functionally just object constraints but assigned to bones.

5
00:00:23.000 --> 00:00:27.000
In this video we're going to go over some basic object constraints,

6
00:00:27.000 --> 00:00:33.000
but keep in mind most of the concepts and constraints in this video also apply to bone constraints.

7
00:00:33.000 --> 00:00:37.000
Now let's go over a few examples of constraints and how to use them.

8
00:00:37.000 --> 00:00:41.000
In this video we're going to go over the copy and limit transform constraints.

9
00:00:41.000 --> 00:00:46.000
These include, for example, the copy and limit location constraints.

10
00:00:46.000 --> 00:00:54.000
The copy location constraint is a simple one that exists as a way for one object to copy the location values of another object,

11
00:00:54.000 --> 00:00:57.000
while ignoring the rotation and scale.

12
00:00:57.000 --> 00:00:59.000
Let's see how this works.

13
00:00:59.000 --> 00:01:06.000
First thing we'll do is add a monkey mesh so we can have an obvious reference or target object.

14
00:01:06.000 --> 00:01:14.000
Now let's say we want to have our cube copy the location of the monkey along the X and Y axis but not the Z axis.

15
00:01:14.000 --> 00:01:19.000
This way we can have the cube follow the monkey around but not leave the ground.

16
00:01:20.000 --> 00:01:27.000
To do this, simply select a cube and go to the constraints tab, indicated by this icon of two objects wrapped together.

17
00:01:27.000 --> 00:01:31.000
From there, open the dropdown menu and select copy location.

18
00:01:31.000 --> 00:01:38.000
This will create and assign the copy location constraint to the active object you have selected.

19
00:01:38.000 --> 00:01:43.000
Now we can go ahead and left click this eyedropper tool next to the object field.

20
00:01:43.000 --> 00:01:49.000
This will use our next left click in the viewport as a way to identify the object we want to reference.

21
00:01:49.000 --> 00:01:52.000
Let's left click our monkey object.

22
00:01:52.000 --> 00:01:57.000
As you can see, the cube's own location is copying the monkey's location exactly.

23
00:01:57.000 --> 00:02:03.000
If we select our monkey, we can move it around to confirm that the cube is indeed constrained to our monkey.

24
00:02:03.000 --> 00:02:06.000
But this isn't exactly what we want.

25
00:02:07.000 --> 00:02:14.000
We want the cube to not leave the ground but still follow the monkey along the X and Y axis.

26
00:02:14.000 --> 00:02:19.000
To do this, we can select our cube again and go into the copy location constraint settings.

27
00:02:19.000 --> 00:02:26.000
Here we can see that there are settings for how to interpret each axis of location data for the target object.

28
00:02:26.000 --> 00:02:34.000
Let's go ahead and uncheck the Z axis as we know we want the cube to ignore the monkey's Z axis location.

29
00:02:34.000 --> 00:02:41.000
And there we go! If we move the monkey around now, we can see the cube follows the monkey while remaining on the grid floor.

30
00:02:41.000 --> 00:02:48.000
Just for fun, let's go ahead and see what the invert checkbox does in the copy location constraint.

31
00:02:48.000 --> 00:02:52.000
Let's check the Z axis back on and then check invert.

32
00:02:52.000 --> 00:02:55.000
Looks like we get a very cool mirror effect.

33
00:02:55.000 --> 00:03:04.000
The cube is being told to do the opposite of whatever the monkey's Z axis location is saying, flipping it across the origin along the Z axis.

34
00:03:04.000 --> 00:03:14.000
Now I mentioned the copy location constraint ignores the rotation of the reference object, but that's not entirely true if we change world space to local space.

35
00:03:15.000 --> 00:03:25.000
The first drop down here controls which axis data to interpret from the reference object, while the second drop down controls which axis data to influence for the selected object.

36
00:03:25.000 --> 00:03:34.000
Let's change the first drop down from world space to local space, allowing us to reference the monkey's local axis location values instead.

37
00:03:35.000 --> 00:03:44.000
As you can see, local space takes into consideration the rotation of the object as the local axis of an object depends on which way it's facing.

38
00:03:44.000 --> 00:03:55.000
Because our monkey is slightly rotated, if we move the monkey along its local X axis, the cube will move along the world X axis instead of following it perfectly.

39
00:03:55.000 --> 00:03:58.000
Feel free to experiment with these settings further.

40
00:03:58.000 --> 00:04:07.000
One more quick thing, let's say we change both of these to world space again, and now we really like how the cube is currently right below the monkey at this frame.

41
00:04:07.000 --> 00:04:12.000
But we want to remove the constraint so we can animate it freely outside of this frame.

42
00:04:12.000 --> 00:04:21.000
Well, let's go ahead and remove the constraint by pressing this X icon next to the eyeball icon in the constraints tab of our properties editor.

43
00:04:21.000 --> 00:04:27.000
But as you can see, if we do that, the transformation driven by the copy location constraint is forgotten.

44
00:04:27.000 --> 00:04:33.000
This isn't ideal for us, so let's undo that with control Z and try something else.

45
00:04:33.000 --> 00:04:38.000
Maybe we can slide the influence to zero? No, that won't work.

46
00:04:38.000 --> 00:04:41.000
But you might notice this X icon next to the influence slider.

47
00:04:41.000 --> 00:04:46.000
If you hover over it, you'll see that it says disable and keep transform.

48
00:04:46.000 --> 00:04:47.000
Let's click it.

49
00:04:47.000 --> 00:04:52.000
This will bring the influence slider to zero, but our cube stays put.

50
00:04:52.000 --> 00:05:00.000
This is because it has replaced the cubes original location data with the constraint driven location data we saw before clicking the button.

51
00:05:00.000 --> 00:05:05.000
This also means that we can actually remove the constraint with no changes.

52
00:05:05.000 --> 00:05:09.000
Location isn't the only transformation value we can copy.

53
00:05:09.000 --> 00:05:15.000
The same concepts apply to the copy rotation, copy scale, and copy transforms constraints.

54
00:05:15.000 --> 00:05:19.000
So what about limiting transformation? That's simple.

55
00:05:19.000 --> 00:05:26.000
Unlike the copy transformation constraints, the limit transformation constraints actually do not require a reference object.

56
00:05:26.000 --> 00:05:30.000
Instead, they use values inputted by the user.

57
00:05:30.000 --> 00:05:37.000
For example, let's say we have our monkey and our cube again, but our cube is scaled up to be a room of some sort.

58
00:05:37.000 --> 00:05:42.000
If we wanted to animate something where we want our monkey to stay strictly within the walls of the room,

59
00:05:42.000 --> 00:05:46.000
we can do that very easily with a limit location constraint.

60
00:05:46.000 --> 00:05:50.000
For this, we'll go into wireframe mode so that we can see and select our monkey.

61
00:05:50.000 --> 00:05:55.000
We can do that by pressing Z and selecting wireframe from the pie menu.

62
00:05:55.000 --> 00:05:59.000
Let's select our monkey and go to the constraints tab in the properties editor.

63
00:05:59.000 --> 00:06:03.000
From the drop down menu, simply select limit location.

64
00:06:03.000 --> 00:06:08.000
At first, nothing happens as all of these check marks are disabled.

65
00:06:08.000 --> 00:06:14.000
These are used to enable the minimum and maximum values allowed for each axis of location.

66
00:06:14.000 --> 00:06:22.000
Just to demonstrate, if we check all of these boxes on, you'll notice that trying to move the monkey will no longer work.

67
00:06:22.000 --> 00:06:29.000
However, if you left click drag the maximum Z value, for example, you'll notice that suddenly you can move the monkey,

68
00:06:29.000 --> 00:06:33.000
but only as far as what you set the maximum Z value to.

69
00:06:33.000 --> 00:06:37.000
Setting ranges like this is how the limit location constraint works.

70
00:06:37.000 --> 00:06:41.000
To achieve our goal of constraining the monkey to stay within the walls of the cube,

71
00:06:41.000 --> 00:06:45.000
we can do trial and error but there is a way that I find is the quickest.

72
00:06:45.000 --> 00:06:48.000
I'll go ahead and demonstrate on the Z axis.

73
00:06:48.000 --> 00:06:53.000
First thing we'll do is simply uncheck the box for the axis limit you want to set.

74
00:06:53.000 --> 00:06:56.000
In this case, we'll start with the Z maximum.

75
00:06:56.000 --> 00:07:00.000
By unchecking this, we can move the monkey along the Z axis as far as we want.

76
00:07:00.000 --> 00:07:04.000
So, we'll place the monkey where we approximately want the limit to be.

77
00:07:04.000 --> 00:07:07.000
Once placed, check the box again.

78
00:07:07.000 --> 00:07:10.000
This will snap the monkey back to its limit,

79
00:07:10.000 --> 00:07:17.000
but you'll then be able to left click drag the maximum Z value until the monkey moves back into the position you brought it to before.

80
00:07:17.000 --> 00:07:22.000
Once the monkey stops moving, you'll know that you increased the value too much,

81
00:07:22.000 --> 00:07:27.000
so adjust a bit and you should be able to match your maximum Z value to where you want the monkey to be.

82
00:07:27.000 --> 00:07:30.000
Luckily, since our cube is the same size all around,

83
00:07:30.000 --> 00:07:37.000
we can just copy this value for all of the maximum values and add a negative sign in front of all the minimum values.

84
00:07:37.000 --> 00:07:42.000
But just keep in mind to adjust these values to your own scene how you see fit.

85
00:07:42.000 --> 00:07:44.000
And there we go.

86
00:07:44.000 --> 00:07:51.000
As you can see, as we move our monkey, the walls of the cube appear to be stopping the monkey's movements in all axis directions.

87
00:07:51.000 --> 00:07:54.000
But you might notice something a bit weird.

88
00:07:54.000 --> 00:07:59.000
If we move the monkey significantly past where it's allowed to go based on the limit location constraint,

89
00:07:59.000 --> 00:08:05.000
and then we try to move it the other way, it'll seem like the monkey takes a while to respond to our actions.

90
00:08:05.000 --> 00:08:10.000
This is because the monkey is actually still calculating its true location,

91
00:08:10.000 --> 00:08:14.000
the location where it's supposed to be if the constraint was not active.

92
00:08:14.000 --> 00:08:21.000
In fact, we can see this visually if we open up the right hand side quick menu and go to item.

93
00:08:21.000 --> 00:08:25.000
This will display our selected object's location data.

94
00:08:25.000 --> 00:08:29.000
And as we can see, as we move the monkey past the limit of the constraint,

95
00:08:29.000 --> 00:08:32.000
its true location value continues to change.

96
00:08:32.000 --> 00:08:36.000
And in order for it to visibly start moving again in the opposite direction,

97
00:08:36.000 --> 00:08:42.000
the value of its location data must fall within the range of the limit location constraint.

98
00:08:42.000 --> 00:08:48.000
To prevent this invisible transformation, simply check this box for transform.

99
00:08:48.000 --> 00:08:53.000
Now, as you can see, even if you try to move the monkey significantly past the limit,

100
00:08:53.000 --> 00:08:57.000
it responds to moving in the opposite direction immediately.

101
00:08:57.000 --> 00:09:01.000
We can further confirm this by again checking the object's location data.

102
00:09:01.000 --> 00:09:07.000
As you can see, the true location now matches the limit of the constraint.

103
00:09:07.000 --> 00:09:13.000
Now let's quickly talk about the difference between working with constraints for bones and objects.

104
00:09:14.000 --> 00:09:19.000
Bone constraints work very similarly to the object constraints I've just shown you.

105
00:09:19.000 --> 00:09:22.000
In fact, they work exactly the same.

106
00:09:22.000 --> 00:09:27.000
But there are some important things I should inform you about working with bones and constraints.

107
00:09:27.000 --> 00:09:33.000
First and foremost, you can set bones as the target object for object constraints.

108
00:09:33.000 --> 00:09:35.000
How do you do this?

109
00:09:35.000 --> 00:09:39.000
Well, let's go ahead and add an armature object into our scene.

110
00:09:39.000 --> 00:09:45.000
These, as you remember, are formed from bones, and we can add more bones by going into edit mode.

111
00:09:45.000 --> 00:09:51.000
I'm going to select the main bone in edit mode, right-click and select subdivide.

112
00:09:51.000 --> 00:09:53.000
This will give us two bones.

113
00:09:53.000 --> 00:09:58.000
Now it's recommended to get into a good habit of naming your bones clearly,

114
00:09:58.000 --> 00:10:03.000
so let's go ahead and do that by selecting each bone and going into the green bone icon tab,

115
00:10:03.000 --> 00:10:06.000
which are the bone properties, in the properties editor.

116
00:10:06.000 --> 00:10:10.000
At the top here, we can left-click to rename our bone to whatever we want.

117
00:10:10.000 --> 00:10:15.000
I'm going to call the top bone top and the bottom bone bottom.

118
00:10:15.000 --> 00:10:21.000
Let's say what we want is for our monkey object to copy the rotation of this top bone here.

119
00:10:21.000 --> 00:10:26.000
If we do a copy rotation constraint and set the target to the top bone,

120
00:10:26.000 --> 00:10:30.000
you can see that it doesn't actually register the top bone,

121
00:10:30.000 --> 00:10:33.000
but rather sets the target as the armature object.

122
00:10:34.000 --> 00:10:40.000
That's because our bone is not an object, but rather exists within the armature object,

123
00:10:40.000 --> 00:10:45.000
similar to how vertices and faces are not objects, but exist within mesh objects.

124
00:10:45.000 --> 00:10:49.000
And unfortunately, the target object must be an object.

125
00:10:49.000 --> 00:10:53.000
However, with our armature selected as the target object,

126
00:10:53.000 --> 00:10:57.000
a bone parameter will appear underneath, marked with this bone icon.

127
00:10:57.000 --> 00:11:02.000
This is where we can select our top bone from the drop-down menu.

128
00:11:03.000 --> 00:11:06.000
This is one of the reasons why naming your bones clearly is important,

129
00:11:06.000 --> 00:11:10.000
as we do not have the eyedropper tool available for this field.

130
00:11:10.000 --> 00:11:13.000
If we now select the armature and go into pose mode,

131
00:11:13.000 --> 00:11:19.000
we can rotate the bone and confirm that the monkey is, indeed, copying the rotation of the bone.

132
00:11:19.000 --> 00:11:22.000
So, what if we want to flip it?

133
00:11:22.000 --> 00:11:26.000
Let's say we want the bone to copy the rotation of the monkey object.

134
00:11:26.000 --> 00:11:27.000
That's simple.

135
00:11:28.000 --> 00:11:30.000
Let's remove the monkey's copy rotation constraint

136
00:11:30.000 --> 00:11:35.000
and then go back into pose mode with our armature object selected.

137
00:11:35.000 --> 00:11:38.000
Once we have the bone we want to constrain selected,

138
00:11:38.000 --> 00:11:43.000
we can add the copy rotation constraint through the constraints tab in the properties editor.

139
00:11:43.000 --> 00:11:45.000
Except, when we do that,

140
00:11:45.000 --> 00:11:49.000
it seems the monkey's rotation actually drives the entire armature object's rotation

141
00:11:49.000 --> 00:11:52.000
instead of just the bone we had selected.

142
00:11:52.000 --> 00:11:57.000
That's because what we added was an object constraint, not a bone constraint.

143
00:11:57.000 --> 00:12:02.000
To add bone specific constraints, you have to go into the bone constraints tab,

144
00:12:02.000 --> 00:12:06.000
indicated by a blue icon that looks like a bone wrapped to another object.

145
00:12:06.000 --> 00:12:12.000
Once here, we can correctly add the copy rotation bone constraint to our selected bone

146
00:12:12.000 --> 00:12:15.000
and set our target object to the monkey.

147
00:12:15.000 --> 00:12:20.000
As you can see, the bone now copies the rotation of the monkey correctly.

148
00:12:20.000 --> 00:12:25.000
There are a few more transform constraints, such as the maintain volume constraint

149
00:12:25.000 --> 00:12:29.000
and the limit distance constraint, that I recommend experimenting with on your own.

150
00:12:29.000 --> 00:12:32.000
But we'll also go over these in a different video.

151
00:12:32.000 --> 00:12:36.000
I hope this gives you a good overview of how constraints work

152
00:12:36.000 --> 00:12:38.000
and how you might use them in your projects.

