Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,140 --> 00:00:02,510
- [Zach] In this video let's
explore the constraints a bit
2
00:00:02,510 --> 00:00:04,490
to better understand them before we go
3
00:00:04,490 --> 00:00:08,180
into adding constraints
to our character rig.
4
00:00:08,180 --> 00:00:10,360
So, in a nutshell, constraints are there
5
00:00:10,360 --> 00:00:13,670
to better control our
objects for animation.
6
00:00:13,670 --> 00:00:16,650
They basically should save
us a lot of manual work
7
00:00:16,650 --> 00:00:19,930
and with constraints we can
either limit our objects
8
00:00:19,930 --> 00:00:22,090
or we can set up certain dependencies
9
00:00:22,090 --> 00:00:24,230
or relationships between objects.
10
00:00:24,230 --> 00:00:27,720
So, here we have this
very simple canon object
11
00:00:27,720 --> 00:00:29,680
which consist out of three main parts,
12
00:00:29,680 --> 00:00:32,130
this gun here, this top part here,
13
00:00:32,130 --> 00:00:33,740
and this bottom part here.
14
00:00:33,740 --> 00:00:35,580
Let's disable the ground for selection
15
00:00:35,580 --> 00:00:38,100
so we can't accidentally select the ground
16
00:00:38,100 --> 00:00:39,928
and the first and very basic constraint
17
00:00:39,928 --> 00:00:43,140
kind of thing you know is the parenting.
18
00:00:43,140 --> 00:00:47,130
So, just imagine this
canon should follow a plane
19
00:00:47,130 --> 00:00:48,840
and maybe shoots on the plane
20
00:00:48,840 --> 00:00:50,670
and then we need to, in this case here,
21
00:00:50,670 --> 00:00:53,600
select these two objects,
make this somehow rotate
22
00:00:53,600 --> 00:00:57,170
in the animation process and
you can imagine that doing this
23
00:00:57,170 --> 00:01:00,770
with many separate objects,
it's a pain in the butt.
24
00:01:00,770 --> 00:01:02,210
So, the first thing we can do,
25
00:01:02,210 --> 00:01:04,220
let's select this one
here, and then this one,
26
00:01:04,220 --> 00:01:07,200
hit Control + P and set
the parent to object
27
00:01:07,200 --> 00:01:09,520
and I will also wanna
connect these two objects,
28
00:01:09,520 --> 00:01:11,710
so let's select this
one, then this one here,
29
00:01:11,710 --> 00:01:14,620
Control + P and click
on set parent to object.
30
00:01:14,620 --> 00:01:17,820
You can also right click and
go into the parent options here
31
00:01:17,820 --> 00:01:19,020
and click on object.
32
00:01:19,020 --> 00:01:20,980
Now, if I move this one here,
33
00:01:20,980 --> 00:01:23,410
you can see all the other
objects are moving along.
34
00:01:23,410 --> 00:01:26,440
If I move this one here, the
gun is also moving along.
35
00:01:26,440 --> 00:01:29,047
So, this one here is a
child of this object here
36
00:01:29,047 --> 00:01:31,310
and this one is a child of this object.
37
00:01:31,310 --> 00:01:33,130
So, that means if I now rotate this,
38
00:01:33,130 --> 00:01:36,080
I can simply animate the
rotation of this object here
39
00:01:36,080 --> 00:01:39,530
and I could animate the
rotation of this object here.
40
00:01:39,530 --> 00:01:42,180
So, this would make our
life already easier,
41
00:01:42,180 --> 00:01:44,140
but let's see what else we can do
42
00:01:44,140 --> 00:01:46,730
with the use of constraints.
43
00:01:46,730 --> 00:01:49,830
So, here in object mode we
have the object constraints
44
00:01:49,830 --> 00:01:52,790
later on for the bones
we have a different tab
45
00:01:52,790 --> 00:01:54,440
for the bone constraints.
46
00:01:54,440 --> 00:01:57,600
So, and in this case, I
wanna set up a target object
47
00:01:57,600 --> 00:01:59,380
and the cannon should follow
48
00:01:59,380 --> 00:02:01,540
the target object automatically.
49
00:02:01,540 --> 00:02:03,060
So, let's select the gun here,
50
00:02:03,060 --> 00:02:06,100
press Shift + S and then
click on cursor to select it.
51
00:02:06,100 --> 00:02:09,920
So, the 3D cursor is over
here and let's hit Shift A
52
00:02:09,920 --> 00:02:12,020
and add a simple empty object.
53
00:02:12,020 --> 00:02:15,370
Let's move this to the front
and let's call it target.
54
00:02:15,370 --> 00:02:18,850
Let's up here, enable the
local transform orientation
55
00:02:18,850 --> 00:02:20,640
and let's also enable the move tools
56
00:02:20,640 --> 00:02:24,370
so we can see the local
axis of the selected object,
57
00:02:24,370 --> 00:02:27,210
which is quite important when
working with constraints.
58
00:02:27,210 --> 00:02:30,210
So, the first thing I want to
do is that the main part here
59
00:02:30,210 --> 00:02:33,440
will always point to this target object.
60
00:02:33,440 --> 00:02:36,240
For that let's select this,
go to the constraints,
61
00:02:36,240 --> 00:02:39,880
and here we have different
categories like transform,
62
00:02:39,880 --> 00:02:41,510
tracking, and relationship.
63
00:02:41,510 --> 00:02:44,350
Motion tracking is something
we can fully ignore here
64
00:02:44,350 --> 00:02:47,570
because this is done
for VFX post-production
65
00:02:47,570 --> 00:02:50,000
in the camera tracking
and motion tracking field,
66
00:02:50,000 --> 00:02:51,260
so we don't need that.
67
00:02:51,260 --> 00:02:52,810
And in the transform category,
68
00:02:52,810 --> 00:02:56,120
we can either copy transforms
from other objects,
69
00:02:56,120 --> 00:02:59,220
like rotation and location,
or we can limit this
70
00:02:59,220 --> 00:03:02,650
so we can say that we only
can rotate to a certain degree
71
00:03:02,650 --> 00:03:04,720
in a certain direction for example.
72
00:03:04,720 --> 00:03:06,360
Then we have the tracking constraints
73
00:03:06,360 --> 00:03:09,710
which allows us to like
look to a certain object
74
00:03:09,710 --> 00:03:12,660
or a stretch to a certain
object, for example,
75
00:03:12,660 --> 00:03:15,120
and then we have other
relationship constraints,
76
00:03:15,120 --> 00:03:18,670
like follow a path, make an
object always hit a floor,
77
00:03:18,670 --> 00:03:21,160
for example, or the child of constraint
78
00:03:21,160 --> 00:03:24,700
which is basically the same
thing as parenting objects,
79
00:03:24,700 --> 00:03:27,560
with the only difference
that we can turn constraints
80
00:03:27,560 --> 00:03:28,393
on and off.
81
00:03:28,393 --> 00:03:31,430
So, in this case, we want to
use the track to constraint,
82
00:03:31,430 --> 00:03:34,680
which means always look
to a certain target object
83
00:03:34,680 --> 00:03:37,370
and the target object we can
define in this field here,
84
00:03:37,370 --> 00:03:39,820
either click here, select the correct one
85
00:03:39,820 --> 00:03:43,250
or use the eyedropper and
select the target object.
86
00:03:43,250 --> 00:03:45,150
Now, the canon is rotated weirdly.
87
00:03:45,150 --> 00:03:48,660
However, it's already always
looking at the target,
88
00:03:48,660 --> 00:03:50,640
but we have to change the axis.
89
00:03:50,640 --> 00:03:53,110
We can see the local
axis of the object here
90
00:03:53,110 --> 00:03:55,860
on the transform gizmo in the
direction where the arrows
91
00:03:55,860 --> 00:03:58,480
are pointing is always
the positive direction
92
00:03:58,480 --> 00:04:00,970
and the opposite is
the negative direction.
93
00:04:00,970 --> 00:04:03,850
Now, it's pointing down here,
which we want to use as axis,
94
00:04:03,850 --> 00:04:05,920
which is the opposite of green,
95
00:04:05,920 --> 00:04:08,700
which means it's the negative Y-axis
96
00:04:08,700 --> 00:04:11,730
and we need to define which
axis should point to the top,
97
00:04:11,730 --> 00:04:14,550
which is the blue Z-axis in our case.
98
00:04:14,550 --> 00:04:17,120
And now, if I move the target the cannon
99
00:04:17,120 --> 00:04:20,400
is always looking in this direction.
100
00:04:20,400 --> 00:04:21,810
This looks good already, however,
101
00:04:21,810 --> 00:04:24,410
I don't want the cannon
to rotate up and down,
102
00:04:24,410 --> 00:04:27,830
it just should rotate
around the Z-axis here.
103
00:04:27,830 --> 00:04:30,630
So, let's add a limit rotation constraint
104
00:04:30,630 --> 00:04:32,310
which we can find over here.
105
00:04:32,310 --> 00:04:35,920
Then I want to block the
Y and the X-axis here,
106
00:04:35,920 --> 00:04:38,300
so let's select X and Y
107
00:04:38,300 --> 00:04:41,070
and I leave minimum and maximum at zero.
108
00:04:41,070 --> 00:04:42,870
That means if I now rotate this,
109
00:04:42,870 --> 00:04:45,700
it can only rotate around the Z-axis.
110
00:04:45,700 --> 00:04:49,500
However, maybe we'll wanna
limit the Z-axis as well
111
00:04:49,500 --> 00:04:51,830
so it can only rotate to a certain degree.
112
00:04:51,830 --> 00:04:55,230
So, let's enable this and
maybe let's set the max to 90
113
00:04:55,230 --> 00:04:57,610
and the minimum to negative 90.
114
00:04:57,610 --> 00:05:00,680
That means if I look from the
top here, and if I move this,
115
00:05:00,680 --> 00:05:02,970
when it hits the 90 degree mark
116
00:05:02,970 --> 00:05:04,770
or the negative 90 degree mark,
117
00:05:04,770 --> 00:05:07,810
it will just stop rotating.
118
00:05:07,810 --> 00:05:09,300
And now, the last thing I want to do
119
00:05:09,300 --> 00:05:13,560
is that this object here is
also pointing to the target
120
00:05:13,560 --> 00:05:15,880
but it only should move up and down.
121
00:05:15,880 --> 00:05:19,600
For that, first of all, let's
also add a track to constraint
122
00:05:19,600 --> 00:05:21,420
and pick the target object.
123
00:05:21,420 --> 00:05:23,970
Now, it's flipped, as you
can see, in this case,
124
00:05:23,970 --> 00:05:28,210
we need the blue positive
Z-axis to point to the object.
125
00:05:28,210 --> 00:05:31,080
So, let's use positive Z and the Y-axis
126
00:05:31,080 --> 00:05:34,090
should point upwards which
is already selected here.
127
00:05:34,090 --> 00:05:36,080
Now, it should do the right thing.
128
00:05:36,080 --> 00:05:39,750
However, I want to also
limit the rotation here
129
00:05:39,750 --> 00:05:44,410
for Z and Y so it's only a
rotating around the X-axis here.
130
00:05:44,410 --> 00:05:47,340
So in this case, again, limit rotation,
131
00:05:47,340 --> 00:05:49,950
I want to block the Y and the Z-axis
132
00:05:49,950 --> 00:05:53,020
and I also want to limit the X-axis.
133
00:05:53,020 --> 00:05:55,270
However, for this, let's
open up the sidebar,
134
00:05:55,270 --> 00:05:58,120
here you can see, since
I rotated the object
135
00:05:58,120 --> 00:05:59,840
to point in this direction here,
136
00:05:59,840 --> 00:06:02,770
it has already the 90 degree rotation.
137
00:06:02,770 --> 00:06:06,090
That means if I now enable
X it will go back to zero
138
00:06:06,090 --> 00:06:08,600
because here we now limit this to zero.
139
00:06:08,600 --> 00:06:11,620
That means we have to
set the maximum to 90
140
00:06:11,620 --> 00:06:14,300
at least to point in this direction here.
141
00:06:14,300 --> 00:06:17,080
Now, it can go from 90 up to zero.
142
00:06:17,080 --> 00:06:19,510
However, maybe we don't
want this to go fully up
143
00:06:19,510 --> 00:06:21,540
so maybe let's pick 45 degrees
144
00:06:21,540 --> 00:06:23,620
so it can only go up to a certain degree
145
00:06:23,620 --> 00:06:25,810
and maybe the cannon
can also move down a bit
146
00:06:25,810 --> 00:06:30,450
so we can increase the maximum
value a bit maybe to 100
147
00:06:30,450 --> 00:06:35,200
then you can see it can move
between 90 and 100 degrees.
148
00:06:35,200 --> 00:06:36,947
So, this looks all good,
149
00:06:36,947 --> 00:06:41,520
right, well, not right.
150
00:06:41,520 --> 00:06:43,930
You can see that the gun in the front
151
00:06:43,930 --> 00:06:47,440
is still doing something
weird and this has to do
152
00:06:47,440 --> 00:06:49,290
with the space.
153
00:06:49,290 --> 00:06:51,040
Well, not the outer space,
154
00:06:51,040 --> 00:06:54,600
here we have the world
space and the local space,
155
00:06:54,600 --> 00:06:56,460
custom space we can fully ignore,
156
00:06:56,460 --> 00:06:58,720
but world and local space is important
157
00:06:58,720 --> 00:07:00,400
when working with constraint.
158
00:07:00,400 --> 00:07:03,640
We can see we have these
options in many constraints
159
00:07:03,640 --> 00:07:06,670
and there we can define
if the whole interaction
160
00:07:06,670 --> 00:07:09,830
of the constraints should
happen in the world space
161
00:07:09,830 --> 00:07:12,120
or in the local space of the object.
162
00:07:12,120 --> 00:07:15,350
So, the world space is
basically the global axis,
163
00:07:15,350 --> 00:07:17,410
the global coordinate system here.
164
00:07:17,410 --> 00:07:19,510
So, that means zero is here in the center,
165
00:07:19,510 --> 00:07:22,170
it's using always the global axis here
166
00:07:22,170 --> 00:07:24,700
so it's very static in the whole world.
167
00:07:24,700 --> 00:07:28,550
However, this object here is
parented and it is rotated
168
00:07:28,550 --> 00:07:31,740
so it has its local
space inside the parent
169
00:07:31,740 --> 00:07:32,850
of this object here.
170
00:07:32,850 --> 00:07:34,900
So in this case, we have to set
171
00:07:34,900 --> 00:07:37,870
the limit rotation
constraint to the local space
172
00:07:37,870 --> 00:07:40,410
which gives us already what we want.
173
00:07:40,410 --> 00:07:43,990
However, just in case up here
in the track to constraint
174
00:07:43,990 --> 00:07:45,870
we can also set that the owner,
175
00:07:45,870 --> 00:07:47,820
which is the object here in this case,
176
00:07:47,820 --> 00:07:49,490
should also be in local space.
177
00:07:49,490 --> 00:07:52,430
However, the target here
can stay in world space
178
00:07:52,430 --> 00:07:55,463
because it's freely moving
around in the world.
179
00:07:56,440 --> 00:07:59,890
And now, you can see what
we did with the constraints
180
00:07:59,890 --> 00:08:04,220
instead of animating and
rotating this and this object
181
00:08:04,220 --> 00:08:07,970
manually to always point to
a certain thing in the world
182
00:08:07,970 --> 00:08:10,510
we can now only animate one object here.
183
00:08:10,510 --> 00:08:13,620
So, for example, if I add a
key frame here for location,
184
00:08:13,620 --> 00:08:15,640
so we only need to animate the location,
185
00:08:15,640 --> 00:08:18,340
then go a bit further
here, then move this here
186
00:08:18,340 --> 00:08:22,190
and maybe a bit upwards,
insert a new key frame,
187
00:08:22,190 --> 00:08:24,333
and now play back the animation.
188
00:08:25,440 --> 00:08:28,080
You can see we animated
the full object here
189
00:08:28,080 --> 00:08:30,800
by only moving the controller object
190
00:08:30,800 --> 00:08:33,870
and this is the whole
point of using constraints.
191
00:08:33,870 --> 00:08:37,060
We want to make our animating life easier.
192
00:08:37,060 --> 00:08:40,010
So, I hope now you have a
very basic understanding
193
00:08:40,010 --> 00:08:42,690
on how we can work with constraints
194
00:08:42,690 --> 00:08:45,500
and in the next video,
let's add the constraints
195
00:08:45,500 --> 00:08:47,770
to our character rig.
196
00:08:47,770 --> 00:08:49,383
If you like, you can save.
16105
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.