Skip to content
Home » Panda3D Part 18 – Inverse Kinematics

Panda3D Part 18 – Inverse Kinematics

Spread the love

In the previous part of the Panda3D series we rigged our slug model. Today we’ll see how to use inverse kinematics, or IK for short, to give ourselves more control over how the bones move.

Open the slug.blend file in Blender.

The Inverse Kinematics Constraint

Let’s go to edit mode, left view (Ctrl + Num 3) and select the second bone from the right:

Inverse Kinematics

Duplicate the bone (Shift + D) and move along the Y axis. This is going to be a controller bone:

Inverse Kinematics

Go to the Bone tab (A) and rename the bone ‘body_IK’ (B). We now want to unparent the bone. You can use the Relations panel in the Bone tab. Just click on the X to the right of the parent’s name to unparent (C) or you can hit Alt + P and select Clear Parent. We moved the controller bone away from the bone that we duplicated, so it’s no longer connected, which you can see in the Relations panel (D):

Inverse Kinematics

Select the end of the controller bone and move it along the Y axis. This way we’ll make the controller bone bigger and easier to quickly identify as the controller bone:

Inverse Kinematics

Now go to pose mode and select the third bone from the right, so the one after the bone you duplicated:

Inverse Kinematics

Go to the Bone Constraints tab (A) and add an Inverse Kinematics constraint (B). Set Target to Armature (C) and Bone to our controller bone (D). The Chain Length (E) tells us how many bones to the left (so parents) should be influenced. By default it’s set to 0, which means all parents should be influenced:

Inverse Kinematics

If you now select and move the controller bone, you can see how the parent bones are moving along. Hit Esc to cancel the operation:

Inverse Kinematics

Our model is fully rigged, we have the inverse kinematics constraint in place. But we want the whole model to move along with the bones, which it doesn’t. This means the armature must exert influence on the mesh.

So, we have to apply the armature to the mesh. To do that, go to object mode and select first the mesh (A) and then the armature (B), thus making the armature the active object:

Inverse Kinematics

Then hit Ctrl + P to set the parent and select With Automatic Weights:

Inverse Kinematics

Your Panda3D Magazine

Make Awesome Games and Other 3D Apps

with Panda3D and Blender using Python.

Cool stuff, easy to follow articles.

Get the magazine here (PDF).

This way we assigned the particular bones to their corresponding portions of the mesh to be controlled. Now go to pose mode, select the controller bone and move it around. You will see that the mesh is moving along:

Inverse Kinematics

And now select some of the tentacle bones one by one and rotate them:

Inverse Kinematics

The mesh is moving along. When you’re done, hit A to select all the bones and then Alt + G to reset the positions of the bones, and finally then Alt + R to reset their rotations:

Inverse Kinematics

Python Jumpstart Course

Learn the basics of Python, including OOP.

with lots of exercises, easy to follow

The course is available on Udemy.

Blender Jumpstart Course

Learn the basics of 3D modeling in Blender.

step-by-step, easy to follow, visually rich

The course is available on Udemy and on Skillshare.


Spread the love

Leave a Reply