In this lesson, we're going to learn all about constraints, and if you've watched the rigging portion
of this course, you'll have already gotten a pretty good understanding about constraints.
But in this case, we're animating we're not building a rig.
So how do we use constraints in this instance where we have the robot and it goes down and the arm needs
to pinch down on it?
So let's create that pinching effect and then it needs to pick up the box.
So we're going to do that with constraints.
So let's get this to pinch.
Should close around frame Harish.
And we can make an antique here as well, because we're not all the way to 10 yet, so we can have it
open all the way and then slam shut and we can make this linear.
So we keep the consistency of what we've established already for what the robot, how the robot moves
with the claw.
And let's just give ourselves even more time here.
Drag this thing out.
So let's say we have it go down clamps and then now let's see maybe eight frames after it's clamped.
Let's count one, two, three, four, five, six, seven, eight.
Or we could just do the math, eight plus six.
Let's have this robot go up and pick up the box.
So let's have it go up, and I think it should go up slower because now it has a little weight.
So we'll drag it up and let's compare the kind of wide translation motion we can see, it is slower,
you know, this would be super slow, right?
This slope is longer and not a seat.
And so we want it to just be slightly slower than it was before.
And we could even because these are weighted tangents now, we can actually minimize drag this out.
So it has a really slow start.
Right.
We could drag a super out like this.
So now we'll have a pretty slow start.
Yeah, I like that.
So now the only problem is the fact that the box isn't going with it.
So how do we animate that constraint that we're going to make?
Well, that's pretty easy.
Let's find the frame where we can kind of set this.
You basically need to choose one frame and it needs to match, you know, where the box is going to
exist on the thing it's constrained to.
Right.
We don't want to constrain the box to this.
And it's not on it.
Right.
It needs to be where it's going to be when we constrain it.
So let's select this.
If we click on the box, let's kind of see how that's set up in the outliner.
We've got a windows.
Let's go to outliner so we can see there's a box geo group.
And in general, whenever you're constraining things, if there's an opportunity to constrain it to
something other than itself in a hierarchy, you always want to go above it.
So we have this empty group here and we can use this to constrain it because guess what?
This controls the box, too.
So instead of using the box constraint, we're going to use the group, because if you remember from
rigging, as soon as we make a constraint, it's going to lock all of these channels.
So for some reason, we wanted to animate maybe the box slips a little bit when it is getting picked
up.
We wouldn't be able to do that if we had controls here.
Right.
So we want to put this on whatever is above this in the hierarchy.
And if this wasn't already there, we could make it.
We can make another one.
We could have two groups above us.
We can just take command.
And then we have another group and we can call this number two.
And now we have a group within a group so we can make this hierarchy for ourselves if we want to.
This is what's important about having a little bit of a technical knowledge, even as an animator,
because there might be instances where you need to create your own tiny little rigs, even if it's just
like an empty group there above a piece of geometry.
It's important to understand the concepts and how these things work together because it won't always
be handed to you.
Right.
Even if you work at a studio with some of the most talented people, even though they could do this
for you like a rig or something, they just might not have the time.
So you need to have a little bit of understanding so that you can do the stuff for yourself.
Even as an animator, if that's all you're interested is animating, you still need to know this stuff.
OK, cool.
So let's actually make the constraint now.
Let's go to the we can go to the rigging or the animation menu.
They're both there.
We could also hit spacebar in the middle of the viewport or not in the middle really anywhere in the
viewport.
And now we have the same menu here.
We have constraint here.
So I like to keep it in animation.
That's what we're doing.
So let's let's go to the animation.
It's the same menu and we can tear that off.
And again, you know, if you followed rigging in the earlier part of this course, then you are familiar
with all these different types of constraints already.
What we're interested in is the parent constraint.
So let's open up the option box of that and close this little menu.
So we have only really one option we need to be concerned about, and that's maintain, offset or not.
And typically you want to maintain offset because like I said earlier, you'll have placed this thing
where you want it to be.
So when you want the constraint to turn on.
So first we need to select the thing that's going to control it and then the child.
Right.
But remember, we don't want to select the geometry.
You want to select the group.
So let's go up here to the outliner and hit command click.
And now we have the group and we can apply with maintain offset meaning there's an offset between these
two pivot points.
The pivot point for this control is up here.
The pivot point for this box is over here.
If we don't have maintain offset on, it's going to snap the pivots to each other and we don't want
that.
We want to maintain this offset between this pivot and that pivot, the distance between those.
That's what the offset means.
Maintain, offset, maintain that distance.
So when we hit apply, it doesn't snap over there.
It stays where it is, except for the fact when the parent here gets moved by its own parent, really
in the hierarchy, this is its parent.
But when that moves in the animation we've already made, the box goes with it.
The problem now is the fact that it's constrained.
So it's always going to be following it.
But we only want this to, you know, get picked up around here.
Let's say frame one fifteen.
So what we can go to is the actual constraint.
And in this constraint, we have the pincher control over here.
And this is why it's also important to name everything properly when you're rigging, because it's easier
to identify when you do constraints like this.
So what we can say is right, click and go to key selected.
So one means on.
And if we go to the frame right before it, we can say zero.
And because we have auto keyframe on over here, it's going to automatically set a key when we change
that value.
So when I close this and when we scrub backward now, we can see it stays there until this key frame
that we made for the constraint itself.
Now, the most important thing to remember with.
Constraints is when you retiming things, it's really easy to forget that you have things constrained
when, let's say we wanted to move all of this animation over like 30 frames or something.
Right.
We moved all this stuff over.
I didn't move the animation of the constraint.
So the constraint is going to get popped on before we want to see right there.
It's already started.
And let me just exaggerate this even more so you can kind of see it more clearly.
We moved all this animation way over as we scrub through and we get to that key frame, I think was
one 15.
Right.
It'll pop up there.
That is not what we want.
You know, we wanted to retime everything.
So the key frames are going to exist on this constraint.
Note here that we made.
So if we're going to select everything we need to remember to include this little group here, this
are not the group, but this node is really what it's called a node.
So we would select all of the controls and accidentally selected the box, but there's no keyframes
on it.
So it won't really matter because there's no you know, there's no keyframes on it.
So there's nothing to select on here in the timeline for it.
But if we command click this, we can see that we that little extra key popped up here.
Let me come in and click that again.
Look at frame 115 and we can see now there's that frame and we know it's selected.
So if I click and every time this whole thing slide it over here again, we can see that when we scrub.
It is actually still following along.
Cool.
So in this lesson, we've learned about constraints and how to have things, you know, follow something
else that we already have animated or animated, too.
So definitely I would encourage you to have fun with this.
If you're kind of bored with this example and you want to make it more interesting, then I challenge
you to make to make it more interesting.
You know, when you look at this animation and you're always kind of evaluating, OK, this looks boring.
I don't really know why.
Start asking yourself questions.
Well, what could I do?
Right.
What can I do to make this more interesting?
Well, I can tell you for this example, you could, you know, the path of motion, which is another
it's not really a principle of animation.
It's more of a concept.
But there's this path of the motion.
The path of motion we've created for this thing is very linear, meaning it's very straight.
Right.
It's a straight line and it goes from point A to point B..
Well, what I think would be more interesting would be, you know, take advantage of the fact this
is 3-D.
Always think, am I taking advantage of the fact that this is 3-D?
If you're not, then you might as well be drawing this with a pencil and paper.
Right.
But for for us, we could move this thing in three dimensions.
It could be over here.
And the Antec could be, you know, whatever it is, we could rotate this thing and it could be a rotation
thing.
Right.
You know, get creative with this.
Make the Antec be more interesting.
Add rotation.
You could have this have a more interesting path of motion.
So maybe it travels down and it's rotated.
The whole thing is rotated back and then it goes up.
Look at that.
That's already more interesting.
But again, we need to remember how we've set up all of these animations.
You can see down here, if we got a chance, like why this didn't really like that.
We didn't have a keyframe over here at S, and we can bring this back up to the level that we need it
to be to to kind of have the tail to settle.
But I mean, even in that one key frame, that one little thing, it's to me it's already more interesting,
the kind of little duck, you know, it moves in another axis.
Right.
Previously was moving in.
One axis was moving.
The X axis was going from right to left.
And that's it in a straight line.
But now we made an in-between right in between two key frames.
We added a key and it added some interest here.
Right.
So I challenge you to use this exercise as a chance to experiment and play around with how do I make
this more interesting?
It's a pretty simple example.
But you know that to me, the most fascinating thing about animation is when you can take a simple,
simple example and really make it interesting.
And that will get people's attention right.
Their expectations.
When they see something simple, like a little robot like this, it might be not very high, but if
you if you do something pretty interesting with it, that's what grabs people's attention.
Right.
So even something you know, we took two seconds here and added, you know, one or two little keyframes.
And it already looks more interesting.
And what I would do is, of course, add an overshoot to this.
You know, it hits this wall.
Here it goes, Pop, and it just pops right there.
So now we add this up and down motion.
Should probably add an overshoot vertically here.
So let's bring this up and over a little bit.
And then I'm just going to middle mouse drag this key over here and set a key.
So I basically copy and paste it with that.
So I like super wonky.
I think the Y translates messed up.
Yeah.
Let's just bring that back.
So we have a little bit of a settle there, but anyway, you get the idea to use these principles in
these concepts, make this your own, OK?
And in the next lesson, we'll continue learning animation and some more advanced concepts and practices
and exercises.
All right.
Thanks for watching by.