inverse cinematics or I. K.
Is one of the most common bone constraints,
as it helps make moving limbs and other joints very intuitive and easy to animate.
But what is IK?
Well, inverse cinematics is the opposite or inverse of forward cinematics or F. K.
So let's figure out what F. K. Is. First
to do this. I'm going to demonstrate using a simple arm rig.
You can find this base arm rig in the same character mesh file
available in the description down below in the collection called arm base rig.
Now, let's talk about what exactly F K. Is
F K. Is simply how bone parent chains work by default.
In other words, moving the parent moves the child.
The reason why it's called forward cinematics is because the transformation of the
bones only influences bones that are further forward down the chain of bones,
which ways forward. Well, if you pretend the tales of the bones are like arrows
than forward down the chain is simply the direction the bones are pointing.
You can also see that moving the child right now will not affect the parents at all.
Great, now, we know what forward cinematics is. So what is inverse schematics?
Well, we know it's the opposite, but what does that mean?
Well, instead of influencing bones forward down the chain,
inverse cinematics allows for the transformation of a bone near the end of
a chain to influence bones that are further up the chain of bones,
basically it's when a child bone has influence over the parent bone in some way
to demonstrate this. I want to quickly show you the auto IK option.
Let's open the right hand side menu by pressing n or clicking this arrow here,
then go to tool and you'll see the auto Ik option.
This is a simple checkbox blender has that
doesn't permanently change your armature at all,
but rather helps when you want to pose bones very quickly.
By enabling this,
you can very easily move bones at the end of
chains to influence the transformation of the entire chain itself.
This is especially handy when animating hands or feet
in real life, when we raise our hands, we don't think,
oh I'll move my upper arm and then extend my forearm
quickly so that it allows my hand to travel upwards.
No,
we tell our hands to move upwards and our upper
arm and forearm act accordingly to accomplish that movement.
It's this kind of natural thinking that like a allows for animators to do
with their rigs with IK by simply telling the hand bone to move upwards.
The upper arm and forearm bones will automatically determine where they have to be
to accomplish that movement.
Likewise,
it's also very helpful for making sure feet stay glued to the ground when needed.
Great. Now that we understand what I. K. Is.
Let's figure out how to apply it to our rigs.
The auto IK feature
is nice for quick posing,
but it doesn't give us full control over the IK and it doesn't work for animation.
So instead,
what we want to do is use the inverse
schematics bone constraint to set it up properly.
The first step is simple.
Let's go into pose mode.
Select our forearm bone
and add the inverse cinematics bone constraint from the bone constraints.
Tab indicated by this wrapped blue bone icon
in the properties editor
from there, you'll notice that we have a few input fields to fill
the target object will be the armature itself,
even though what we really want is to target a specific bone,
but that's within that armature.
So let's select armature from the drop down.
Then we can select the bone we want in the bone input field.
This works in a similar way to the track two and stretch to
constraints where our target bone is where we want our active bone 2.2.
So in this case will want to choose the hand bone.
However, when we select our hand bone now and try to move it,
it doesn't actually seem to do anything.
In fact, it's not translating at all as it's still connected to the forearm bone,
let's simply go into edit mode and disconnect our hand bone from the forearm bone.
But keep it parented.
Now, as you can see,
we can translate our hand bone and it influences the forearm bone,
but it also influences the entire rig.
This is not what we want. We only want the arm to bend.
So let's go into our inverse cinematics bone
constraint and go to our chain length option.
The default is zero and this simply goes up the entire bone chain.
The active bone is parented to.
So in our case it goes all the way down to the bottom of the spine.
This is indicated by the yellow dotted line here
by changing the chain length value are yellow dotted
line will show how far up the chain are.
Inverse. Cinematics will take effect.
You might see a bit better in wireframe mode.
However,
the only bones we want influenced by the inverse
schematics constraint are the forearm and upper arm bones.
So we want a chain length of two.
Now when we move our hand bone,
it correctly influences only the forearm and upper arm.
But I don't think we wanted to be freaking out like this.
It doesn't seem like it's very animate herbal or stable. So what's happening here?
Well, quite simply
remember in the parenting video, when I said you can't form a loop in the parents.
Well, we sort of just did here.
If you think about it, the forearm is pointing to the hand
but the hand is parented to the forearm.
This means that when the hand moves
the forearm will try to point to the hand.
But if the forearm moves to point to the hand,
the hand will have to move because it's parented to the forearm,
thus moving the hand further,
which will move the forearm further to point to the hand which will move the hand
further because it's parented which will move the
forearm to point to the hand etcetera etcetera.
This is called a cyclic dependency and we don't want that.
So let's go ahead and um parent the hand entirely so
that we can move our hand independently from our forearm.
Nice as you can see moving our hand now bends the elbow in a very natural way.
The only issue we have now is because the hand is no longer connected to the forearm.
We can now stretch the hand out away from the forearm which is an ideal.
So the most common workaround for this is to simply go back into edit mode
re parent the hand to the forearm.
Then duplicate the hand bone and a new parent the duplicate.
Now we have an independent controller bone that we can point to. Instead
let's call this bone hand underscore I. K.
Going back into pose mode.
We can select our forearm.
Go into the bone constraints tab and change the bone target from hand
to hand I. K.
Now as we move our hand IK bone
the forearm and upper arm deformed nicely.
And we can move this hand IK controller out without stretching the hand itself.
However now to rotate the hand bone itself we
would have to switch between animating the hand I.
K. And the original hand bone.
That's a bit tedious for our animators.
So let's add a simple copy rotation constraint for the original hand
deformation bone to follow the hand iK bone for easy animation.
I'm also going to make the hand iK bone a bit bigger and
edit mode so it's easier to differentiate from the original hand bone.
Although giving it a nice custom bone shape is an option as well.
Great.
Now we have a nice basic iK rig.
Except you may notice that sometimes when we move the hand bone around
the elbow sort of bends the wrong way,
this is not ideal and some of you may remember that there
is still one more input field in our inverse schematics constraint.
Let's go back into it and see what it is.
Yes, the pole target input field.
This will be helpful for solving the issue of joints bending the wrong way.
During inverse schematics,
a poll target is simply a reference object or bone that the elbow
joint or inverse schematics joint will try to point to as the bones bend
for this,
we can simply create a new bone by duplicating the
hand like a bone and moving it behind the elbow.
I'm going to rotate it so that it points away but
it doesn't matter because only its location is actually referenced.
Let's rename this to elbow underscore target.
Now we can go back into our inverse schematics constraint
settings and simply input the armature again for the object field
for the bone input will want to select
elbow underscore target.
And now as you can see when we move our hand like a bone,
the elbow never bends in the wrong direction anymore.
Except that's because the elbow doesn't bend at all.
This is because quite simply our bones were created to straight
and it doesn't know which direction to start bending.
So let's very quickly go into edit mode
and just drag her elbow joint slightly backwards.
Now as you can see our elbows, Ben just fine
except it's still in the wrong direction.
But don't worry,
that's because we forgot to set one
more value in the inverse schematics constraint.
Let's go ahead and keep our elbow bent and then select our forearm bone again.
We can go into the inverse schematics constraint and click and drag
this poll angle value until it points to the pole target correctly.
And that's it. We now have a working in verse cinematics rig in blender