constraints are valuable tools used in the process of rigging.
They allow for simple and complex relationships to
be formed between bones and between objects.
There are two main types of constraints, object constraints and bone constraints.
For the most part,
bone constraints are functionally just object constraints but assigned to bones
in this video,
we're going to go over some basic object to constraints but keep in mind
most of the concepts and constraints in this video also apply to bone constraints.
Now let's go over a few examples of constraints and how to use them.
In this video, we're going to go over the copy and limit transform constraints.
These include, for example, the copy and limit location constraints.
The copy location constraint is a simple one that exists as a way for one
object to copy the location values of another
object while ignoring the rotation and scale.
Let's see how this works.
First thing we'll do is add a monkey mesh so
we can have an obvious reference or target object.
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.
This way we can have the cube. Follow the monkey around but not leave the ground.
To do this simply select a cube and go to the
constraints tab indicated by this icon of two objects wrapped together
from there. Open the dropdown menu and select copy location.
This will create and assign the copy location constraint
to the active object. You have selected.
Now we can go ahead and left click this eyedropper tool next to the object field.
This will use our next left click in the view port
as a way to identify the object we want to reference.
Let's left click our monkey object.
As you can see the cube's own location is copying the monkeys location exactly.
If we select our monkey,
we can move it around to confirm that the cube is indeed constrained to our monkey,
but this isn't exactly what we want.
We want the cube to not leave the ground but
still follow the monkey along the X and Y axes
to do this.
We can select our cube again and go into the copy location constraint settings
here we can see that there are settings for how to interpret each axis of location.
Data
for the target object.
Let's go ahead and uncheck the Z axis.
As we know we want the cube to ignore the monkeys Z axis location
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.
Just for fun.
Let's go ahead and see what the invert
checkbox does in the copy location constraint.
Let's check the Z axis back on and then check invert
looks like we get a very cool mirror effect.
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.
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.
The first drop down here controls which access
data to interpret from the reference object.
While the second drop down controls which access
data to influence for the selected object.
Let's change the first drop down from world space to local space,
allowing us to reference the monkeys local axis location values instead.
As you can see,
local space takes into consideration the rotation of the object as
the local axes of an object depends on which way it's facing
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.
Feel free to experiment with these settings. Further
One more quick thing let's say we change both of these two world space again and
now we really like how the cube is currently right below the monkey at this frame
but we want to remove the constraint so we
can animate it freely outside of this frame.
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.
But as you can see if we do that,
the transformation driven by the copy location constraint
is forgotten.
This is an ideal for us. So let's undo that with control Z and try something else.
Maybe we can slide the influence to zero.
No that won't work.
But you might notice this X. Icon next to the influence slider.
If you hover over it, you'll see that it says disabled. And keep transform,
let's click it.
This will bring the influence slider to zero but our cube stays put.
This is because it has replaced the cubes original location data with
the constraint driven location data we saw before clicking the button.
This also means that we can actually remove the constraint with no changes.
Location isn't the only transformation value. We can copy
the same concepts apply to the copy, rotation,
copy scale and copy transforms constraints.
So what about limiting transformation
that's simple.
Unlike the copy transformation constraints.
The limit transformation constraints actually do not require a reference object
instead they use values inputted by the user.
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.
If we wanted to animate something where we want our
monkey to stay strictly within the walls of the room.
We can do that very easily with a limit location constraint
for this will go into wireframe mode so that we can see and select our monkey.
We can do that by pressing Z and selecting wireframe from the pie menu.
Let's select our monkey and go to the constraints tab in the properties editor
from the drop down menu simply select limit location
at first. Nothing happens as all of these. Check marks are disabled.
These are used to enable the minimum and
maximum values allowed for each axis of location.
Just to demonstrate
if we check all of these boxes on,
you'll notice that trying to move the monkey will no longer work.
However, if you left click, drag the maximum Z value for example,
you'll notice that suddenly you can move the monkey but only
as far as what you set the maximum Z value to
setting ranges like this is how the limit location constraint works
to achieve our goal of constraining the monkey to stay within the walls of the cube.
We can do trial and error but there is a way that I find is the quickest.
I'll go ahead and demonstrate on the Z axis.
First thing we'll do is simply uncheck the box for the axis limit you want to set.
In this case we'll start with the easy maximum
by checking this we can move the monkey along the Z axis as far as we want.
So we'll place the monkey where we approximately want the limit to be
once placed. Check the box again.
This will snap the monkey back to its limit
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.
Once the monkey stops moving,
you'll know that you increase the value too much so a just
a bit and you should be able to match your maximum Z value
to where you want the monkey to be
luckily since our cube is the same size all around,
we can just copy this value for all the maximum values
and at a negative sign in front of all the minimum values
but just keep in mind to adjust these values to your own, seen how you see fit
and there we go.
As you can see as we move our monkey,
the walls of the cube appear to be
stopping the monkeys movements in all access directions
but you might notice something a bit weird
if we move the monkey significantly past where it's
allowed to go based on the limit location constraint
and then we try to move it the other way
it will seem like the monkey takes a while to respond to our actions.
This is because the monkey is actually still calculating its true location,
the location where it's supposed to be. If the constraint was not active.
In fact we can see this visually if we open up the right hand side,
quick menu and go to item
this will display are selected objects location data
and as we can see as we move the monkey past the limit of the constraint,
its true location value continues to change
and in order for it to visibly start moving again in the opposite direction.
The value of its location data must fall
within the range of the limit location constraint.
To prevent this invisible transformation,
simply check this box for transform.
Now as you can see,
even if you try to move the monkey significantly past the limit,
it responds to moving in the opposite direction
immediately.
We can further confirm this by again checking the objects location data
as you can see
the true location now matches the limit of the constraint.
Now let's quickly talk about the difference between
working with constraints for bones and objects.
Bone constraints work very similarly to the object constraints.
I've just shown you
in fact they work exactly the same
but there are some important things I should
inform you about working with bones and constraints.
First and foremost
you can set bones as the target object for object constraints.
How do you do this?
Well let's go ahead and add an armature object into our scene.
These as you remember,
are formed from bones and we can add more bones by going into edit mode,
I'm going to select the main bone in edit mode.
Right click and select subdivide
This, will give us two bones.
Now it's recommended to get into a good habit of naming your bones clearly.
So let's go ahead and do that by selecting each bone and going into
the green bone icon tab which are the bone Properties in the properties editor
at the top here we can left click to rename our bone to whatever we want.
I'm going to call the top bone
top
and the bottom bone bottom.
Let's say what we want is for our monkey object
to copy the rotation of this top bone here,
if we do a copy rotation constraint and set the target to the top bone,
you can see that it doesn't actually register the top bone,
but rather sets the target as the armature object.
That's because our bone is not an object but rather exists within the armature
object similar to how verses and faces are not objects but exist within mesh objects
and unfortunately the target object must be an object.
However, with our armature selected as the target object,
a bone parameter will appear underneath, marked with this bone icon.
This is where we can select our top bone from the drop down menu.
This is one of the reasons why naming your bones clearly is important
as we do not have the eyedropper tool available for this field.
If we now select the armature and go into pose mode,
we can rotate the bone and confirm that the monkey is indeed
copying the rotation of the bone.
So what if we want to flip it?
Let's say we want the bone to copy the rotation of the monkey object.
That's simple.
Let's remove the monkeys copy rotation constraint and then
go back into pose mode with our armature object selected
once we have the bone we want to constrain selected.
We can add the copy rotation constraint through the constraints.
Tab in the Properties editor.
Except when we do that,
it seems the monkeys rotation actually
drives the entire armature objects rotation
instead of just the bone we had selected.
That's because what we added was an object constraint, not a bone constraint.
To add bone specific constraints,
you have to go into the bone constraints. Tab
indicated by a blue icon that looks like a bone wrapped to another object.
Once here,
we can correctly add the copy rotation boned constraint to our selected bone
and set our target object to the monkey.
As you can see
the bone now copies the rotation of the monkey correctly.
There are a few more transform constraints
such as the maintain volume constraint and the limit distance constraint
that I recommend experimenting with on your own.
But we'll also go over these in a different video.
I hope this gives you a good overview of how
constraints work and how you might use them in your projects