In Blender 2.5 video tutorial series, we will be going over how set up a rig that can easily switch between FK (Forward Kinematics) and IK (Inverse Kinematics) controls using a single slider.

We’ll first go through the process of preparing and applying the Armature. We’ll then look at making the rig switch between the FK and IK controls using Bone Constraints and a Custom Property. We’ll then proceed to add in some Drivers and drawing the necessary properties in the UI using Python. Lastly we’ll quickly go over Bone Shapes by changing how the Bones appear in Pose Mode.

You must be logged in to upload images. Register

Discussion

62 Responses to “Creating an FK/IK Rig”
  1. Posts: 43

    Wow!!… I have to watch it!!!.
    Thanks!!!.

    #
    1
    Feb 7, 2011 at 11:59 am
  2. Matt Heimlich
    Posts: 13

    Fantastic. We need more rigging and animation tutorials!

    #
    2
    Feb 7, 2011 at 12:02 pm
  3. Neil Brewer
    Posts: 11

    First Post! (maybe)
    Looking forward to this tut! You covered some of this in the dragon tuts, but I’m looking forward to a focused tutorial.

    Thanks,
    Neil

    #
    3
    Feb 7, 2011 at 12:30 pm
  4. Posts: 10

    can you teach how to make a swich that doesnt have a blend, that put’s the fk arm back where the ik is, and vice versa?…
    it’s pretty common nowdays, but the only person i’ve seen having something like this is Bassam K.

    it’d be fantastic to learn that.

    #
    4
    Feb 7, 2011 at 1:01 pm
  5. Holy smokes, just what I wanted to see. A tutorial on rigging that doesn’t just use existing rigs is ver, very helpful! You guys put out better training than a lot of other companies. This is why I’m switching to Blender – powerful software and amazing community.

    Blender cookie is top notch and I will buy any series you publish.

    #
    5
    Feb 7, 2011 at 1:02 pm
  6. Posts: 12

    Wow! you read my mind? It was exactly what he was doing, I reached a nice result, but I’ll see your tutorial to see if can get any tips! ;)

    #
    6
    Feb 7, 2011 at 1:50 pm
  7. Thanks!!!. If possible, please make tutorial about how to do FK-IK snapping (something like this http://vimeo.com/16939599.

    #
    7
    Feb 7, 2011 at 2:57 pm
    • Posts: 225

      I think this is the same thing that Luciano meant in his comment. I’d honestly never seen controls like that, but I can see why and where they’d come in handy. I’ll see what I can do! =)

      #
      7.1
      Feb 9, 2011 at 1:45 pm
  8. Posts: 169

    why do I always discover the new tut’s when I’havent got the time :(

    #
    8
    Feb 7, 2011 at 3:08 pm
  9. Posts: 136

    GReat Tutorial
    :D

    ty

    #
    9
    Feb 7, 2011 at 3:45 pm
  10. Craig Hellman
    Posts: 17

    Great tutorial, loved it all.
    Wonderful custom UI. Python and rigging, great combo.

    #
    10
    Feb 7, 2011 at 5:45 pm
  11. Posts: 35

    Thank you soooooo much I NEEDED THIS SO BADLY thank you, Can you do one on a Face or a Leg.

    #
    11
    Feb 7, 2011 at 6:17 pm
    • Posts: 225

      Hmm, they’re all the same, really. Just create the 3 rigs and hook them up like I did these. I have to wonder where IK plays a part in facial rigging though (aside from eye-tracking). Is there anything specific you’re trying to accomplish?

      #
      11.1
      Feb 9, 2011 at 1:47 pm
  12. Posts: 175

    It is an excellent tutorial covering a range of advanced and intimidating subjects. Thank you, Patrick, for the simple explanations and I look forward to building a rig like this one day.

    Cheers,

    #
    12
    Feb 7, 2011 at 6:22 pm
  13. Posts: 254

    Great tut. Thanks Patrick and Blender Cookie.

    #
    13
    Feb 8, 2011 at 1:43 am
  14. Terry Wallwork
    Posts: 5

    Excellent Tutorial, keep them coming :)

    #
    14
    Feb 8, 2011 at 4:24 am
  15. Unhurdof
    Posts: 10

    Great tut. Thanks Patrick and Blender Cookie!

    Can you do a tutorial on using shape key drivers and corrective shape keys on shoulders to fix deformations on shoulder joints?

    #
    15
    Feb 8, 2011 at 6:24 am
    • Posts: 43

      Unhurdof, David Ward already has done a tutorial about what you are looking for. here is http://www.blendercookie.com/2010/03/10/working-with-shapekey-drivers/ . When a bone reachs a certain angle the shape key starts to animate.

      #
      15.1
      Feb 8, 2011 at 5:50 pm
      • Unhurdof
        Posts: 10

        Thanks Hetors,
        Some were saying that the functionality changed since that tutorial was recorded. Maybe I’ll just have to experiment with it myself and I could be wrong, but from what I understand it changed after 2.55.

        #
        15.1.1
        Feb 27, 2011 at 4:18 am
  16. Prometheus
    Posts: 5

    Whoa, awesome tutorial. This will make animating or posing in general a lot easier. Great insights into blender-python, too. Didn’t think it was that simple to mess with the interface.

    #
    16
    Feb 9, 2011 at 1:14 pm
    • Posts: 225

      Thanks, I’m glad you liked it! =) The new 2.5-Blender-Python is an absolute joy to work with. If you’re interested in this subject, we recently released a tutorial going over the basics of Blender-Python and UI manipulation you may be interested in as well.

      -Patrick

      #
      16.1
      Feb 9, 2011 at 1:53 pm
  17. Posts: 13

    Wow, some very nice tips and tricks in this tutorial!

    #
    17
    Feb 9, 2011 at 6:15 pm
  18. Posts: 17

    OMG! OMG! OMG! I’ve been looking for a tutorial like this for like forever! Thanks so much for making this guys. I really appreciate all the hard work you guys put into these.

    #
    18
    Feb 9, 2011 at 9:25 pm
  19. Posts: 169

    yeah Great tutorial,
    and given by a Dutchman,very nice :)
    Patrick,maybe the most nooby question you’ve ever heard, but hm.. whats the use of IK and FK bones? I mean doesn’t normal rigging work properly or have I just not been watching carefully.. yeah as I said, most nooby question on the page or not?

    #
    19
    Feb 10, 2011 at 4:55 am
    • Posts: 225

      Haha, darn my obvious accent! (Yes, I’m Dutch.) =P I’m not sure if I completely understand your question.
      If you mean what the difference in FK and IK is, it has to do with the posing. In FK, you have to move around each individual bone to get the pose you want (i.e.: upperarm, lowerarm, hand). Using IK, you can move around just the hand for instance, and the arm-bones will fall into place (you can have control over this using pole-targets).
      If you just meant to ask about the use of 3 rigs, I agree it seems a bit needlessly complicated at first. However, ‘normal’ rigging wouldn’t allow you to switch from IK to FK and back, unless you’d animate the IK-strength directly. This could cause problems in rotation (because you’re rotating bones in FK-mode that belong to an IK-chain), or cause snapping issues going from one to the other. Having 3 rigs is just a ‘safer’ way of dealing with different types of control within one armature.

      Hope this helped!
      Patrick

      PS: Never be afraid to ask a question, no matter how ‘nooby’. We all have to learn and start somewhere, right? ;)

      #
      19.1
      Feb 10, 2011 at 9:31 am
      • Posts: 169

        Thanks, that does anser my question :)

        #
        19.1.1
        Feb 11, 2011 at 9:44 am
  20. Posts: 1

    what blend files are you selling for this tutorial?

    #
    20
    Feb 10, 2011 at 9:29 am
    • Posts: 225

      The source files contain the tutorial and the finished .blend. This includes the fully rigged base mesh and Python script.

      #
      20.1
      Feb 11, 2011 at 2:04 pm
  21. Posts: 10

    Well.. I must say that programming part is a bit too hard and time consuming for me. Would be great to have just some kind of fast drag-n-drop feature.. or “add to sidebar” button in right-click menu.. so you shouldn’t have to do that manually all the time. And it’s just one arm without fingers!

    #
    21
    Feb 10, 2011 at 12:31 pm
    • Posts: 225

      Yes, I figured that doing the fingers/ legs/ rest of the body would not be needed for this tutorial. It’s already over 50 minutes as it is and I thought this would get the basic idea of across. Is there anything in specific you’d like to know?

      #
      21.1
      Feb 11, 2011 at 2:11 pm
  22. stvndysn
    Posts: 16

    patrick that tutorial as just probably saved mine and my mates life the python bit was just what we wanted..

    #
    22
    Feb 11, 2011 at 12:59 pm
  23. Nik
    Posts: 4

    Just what i needed! Man, BC always has the best tutorials. I was going to investigate waylow’s “Buck 2.5.6″ rig, but this already saves me the trouble.

    #
    23
    Feb 12, 2011 at 4:09 am
  24. TheLogan
    Posts: 1

    I really enjoyed this tutorial, I’m not sure sure how useful it will be for me since I do game development (in unity3D, not in blender =) ) and not rendered films, but I still really enjoyed going through it!

    #
    24
    Feb 18, 2011 at 5:30 am
  25. Niko40
    Posts: 2

    Real nice tutorial you have there. :D This is something I really needed and just in time too.

    Now that you started talking about properties, it would be real nice to know a bit more about those too. I’m sure more will follow but personally it would be real nice to know how to adjust shape keys the same way as the custom properties. I could of course drive those via custom properties now but if there is a more direct way, that would be nice.

    Also I have a furry character with 2 set of clothes, more clothes in the future. I need to make some textures to direct the fur properly for each piece of clothing and hide the the clothes I don’t need atm. I rather hide those as individual objects than keep them in multiple layers because if I go and mix those up (Like changing just one piece of the clothing) there could at some point be more clothes than layers in Blender. It would be nice to know more about operators as it seems like I need to make one for that. Something to adjust multiple properties at the same time anyhow.

    Anyway, nice work again and knowing more about operators and creating custom properties would be nice. :)

    #
    25
    Feb 18, 2011 at 6:57 pm
  26. Posts: 115

    I just wanted to say that the tutorial is just way way way too advanced or complex, there is just too much info to digest. I dont think i will ever be able to learn this, every step makes me ask more questions.. why is this, why that , why do that step etc…. is there a more realistic starting point for rigging a character, i feel i am missing all the basics on animation or rigging.

    #
    26
    Feb 18, 2011 at 8:48 pm
  27. Posts: 115

    P.S I wondered is there just an overview of fk ik and rigs, i try to use mancandy etc, but these tools all seem to assume i know how to use them. which i dont. its very frustrating , can you point me in the right direction here?

    #
    27
    Feb 18, 2011 at 8:55 pm
    • Posts: 2951

      Hi Greg, hang in there! You will get it. This is indeed and advanced tutorial, as it was intended, so it’s expected that you may feel overwhelmed if you’re just starting out with rigging. I don’t currently know of any basic tutorials that cover IK/FK but I have added it to my immediate to-do list to try and help you out. If interested there my 2010 Training Series covers IK/FK along with other basics of rigging: http://www.blendercookie.com/2010-blender-training/

      Regardless you can expect a tip soon!

      -Jonathan

      #
      27.1
      Feb 19, 2011 at 1:29 pm
  28. Posts: 115

    Thanks Jonathan,
    i feel like a dumbass when i should get it by now!
    I have the 2010 series on my list, didn’t realise you covered rigging in there, thanks !
    By the way, i saw patricks tutorials on the sio2 game engine for i phone, i mean he’s awesome, i couldn’t work out how he gets alpha mapped grass to billboard towards the camera, spent hours on that to no result, was dissapointed as that would be really cool, i intend to get a little game demo eventually, may take me years at this rate!
    thanks for the response, i will look out for the tuts!

    #
    28
    Feb 20, 2011 at 3:58 am
  29. Posts: 3

    does anybody know why this custom menue doesn’t shows up in my property panel(“N” key) even if I update it several times ? … and it seems that I’ve done exactly as in tutorial the rest of the stuff.

    thanks in advance! ;)

    #
    29
    Feb 24, 2011 at 6:11 am
    • Posts: 225

      Hey Nooby (Well that’s a customer-friendly way of starting a comment. xD),

      As Someperson1 pointed out, there’s been an API change in the latest graphicall builds. I’m on it; expect a fix tip video ASAP! =)

      #
      29.1
      Feb 28, 2011 at 4:50 pm
    • Night
      Posts: 3

      Thanks Patrick. Awesome! Demistifiyng!

      My first good stab at python, had the same issues of nothing showing up in properties window. Seems 2.59 wants a little more info see the changes below. Found the http://www.blender.org/2.59…API examples, got them to work, then I could see what was missing.

      Also the tut leaves you hangin on how to keyframe the IK Strength. Go into Pose mode and open the Dopesheet somewhere off to the side. Right click on the custom property you made called IK Strength in properties panel(same place you copied the data from at one point) and select add keyframe.

      Next do a visual-loc-rot before and after on the bones you moved for both the ik and fk. Play the blend and voila you’ve got some very smooth in-betweening. I know it’s an old post but if anyone else gets this far and is on 2.59, they’ll be wowed once you get it working.

      You can do things like start in a complex grip in IK, then a swinging move in FK, then blend to the IK complex finish. FK rotates preditcably like swinging, but too fidgity to do natural looking poses quicky like IK. Not sure if that’s how it’s supposed to be used, but I see all sorts of new solutions with the 3 rigs and switching between the ik and fk.

      Cheers

      class ShowButtons(bpy.types.Panel):
      bl_idname = “OBJECT_PT_ShowButtons” #here…
      bl_space_type = “VIEW_3D”
      bl_region_type = “UI”
      bl_label = “Rig Layers”
      bl_context = “object” #here…

      @classmethod
      def poll(self, context):
      if(bpy.context.active_object.type == ‘ARMATURE’):
      return(True)

      def draw(self, context):
      layout = self.layout
      row = layout.row()
      row.label(“Arm.L”)
      row.prop(context.active_object.data, “layers”, index=1, toggle=True, text=”FK”)
      row.prop(context.active_object.data, “layers”, index=2, toggle=True, text=”IK”)

      bpy.utils.register_class(ShowButtons) # and here…

      #
      29.2
      Sep 2, 2011 at 7:21 pm
      • Meikel
        Posts: 12

        Yeah,
        the register_class() does the trick.
        I’m just wondering how I can execute the script on file load. It is a bit odd
        to open the file and start the script by hand. Would be easier if the buttons
        and sliders were simply *there* on file load.

        Any suggestions to this issue?

        Regards,
        Meikel…

        P.s.: very interesting totorial, Patrick! :-)

        #
        29.2.1
        Sep 4, 2011 at 1:45 am
  30. Someperson1
    Posts: 1

    api changes kill script

    #
    30
    Feb 28, 2011 at 10:45 am
  31. Posts: 16

    Patrick,

    Great tutorial. It is a bit advanced, but not so much that I can’t follow with a little head scratching.

    Question, as I build my custom rigs, I’d like to just take them from one character to the next. Is there a way to move the scripts over with them or do I need to do a copy paste each time?

    Thanks

    #
    31
    Mar 19, 2011 at 7:57 am
  32. Posts: 43

    Patrick, I’ve seen other files where you don’t need to run de script everytime you open the file to get the buttons working on the panel, how can I do that?.
    Great tutorial and I’m waiting for more Python scripting tutorials for Blender.
    (… and waiting for my answer :) ).

    #
    32
    Sep 9, 2011 at 11:42 am
    • Night
      Posts: 3

      Check out how I use it in the .blend. I just press Run Script when I load the file from the text editor. However it has the basic code to run as an addon and can be installed. The reason I don’t use it as addon is the properties on the armature don’t exist yet in a new file and may throw an exception or something.

      http://www.blendswap.com/3D-models/animation/biped-rig-25-packed-blend/

      #
      32.1
      Sep 21, 2011 at 5:54 pm
      • Posts: 43

        A couple of days ago, on a forum, finally I get the answer for that question.
        In the text editor you have to name you script with the extension “.py”, and then check “register” (next to the input field), that’s all.
        Thanks anyways Night (I saw your blend file and all your links you post on blendswap and they are amazing).

        #
        32.1.1
        Sep 22, 2011 at 10:31 am
  33. meikel
    Posts: 12

    Hi cookies,

    I recently found a crucial problem with the driver setup in this rig presented by Patrick.
    The rig works perfectly as is, but when you set it up as a group in order to link the rig
    into a scene file the IK/FK switch is not working anymore! Thus, the rig as described here
    cannot be used in a dedicated rig file for animation projects.
    However, the solution is not obvious but simple: You only have to change the Property
    ID Type in the driver from Armature to Object and then select the Armature. Then you
    can link the rig into a scene file and the IK/FK switch still works.

    best regards,
    meikel…

    #
    33
    Oct 10, 2011 at 6:31 pm
    • meikel
      Posts: 12

      Addendum:

      the custom property has to go into the bone panel then rather than into the armature object data panel.

      #
      33.1
      Oct 10, 2011 at 6:38 pm
  34. Night
    Posts: 3

    Hi Meikel,

    I noticed an issue (for the same reason Meikel points out, I think)of the keyframes being created on the dopesheet only, under Armature, but not showing under ArmatureAction or in the Action Editor. This presents a problem if you are making individual actions, but not if you make one big action long action with everything in it, which is how I export to Unity anyway, so didn’t see it as a problem initialy. So beware…

    Miekel, how did you change the script to pick up the propery at the bone level? i.e. row.prop(context.active_object.data, ‘["Arm.R"]‘, slider=True, text=”R”).

    Cheers

    #
    34
    Oct 12, 2011 at 11:33 am
  35. meikel
    Posts: 12

    hi Night,

    yeah, yours is another problem you get when using this kind of custom property.

    the line in the script translates to:

    row.prop(context.object, ‘["Arm.R"]‘, slider = True, text = “R”)

    show-stopper:
    when the rig is linked into a scene file using a group, one has to make the armature in the group
    a proxy by hitting ctrl-alt-p and then selecting the armature from the popup menu. after that, blender
    renames the linked armature to “_proxy” where “” is the name you gave to
    the group in the rig file. you have to rename this to the exact name of the armature in the rig file!
    otherwise the IK/FK sliders won’t work because the referencing variable value has the wrong name.

    took me some time to figure out all that. I suggest BC and/or Patrick Boelens do a follow-up tutorial
    on this issue since it might be interesting not only for me ;-) *hint hint*

    btw, I started a BA-thread on this very issue. you can find it at: http://blenderartists.org/forum/showthread.php?233413-Linking-rigfile-into-scenefile

    might be interesting to read…

    regards,
    meikel…

    #
    35
    Oct 12, 2011 at 12:32 pm
  36. manish
    Posts: 1

    I’m not much fan of blender, got a chance to work on it, and I make my version of FKIK, it switched visibility along with constraints blend, not required any prior knowledge of scripting. Hope it will help, here is the link : http://www.manishtoons.com/blog/2012/01/fkik-setup-with-visibility-switching-in-blender/

    #
    36
    Jan 6, 2012 at 6:22 am
  37. vesipeto12
    Posts: 3

    How to mirror this to the otherside of the mesh?

    #
    37
    Mar 18, 2012 at 5:26 am
  38. Posts: 13

    This question was asked and not answered: How do you make the FK bones (FK controls) follow the IK bones when in IK mode and the IK bones (IK control objects) follow the FK bones when in FK mode?

    Without this IK/ FK switching is very difficult

    #
    38
    Jul 19, 2012 at 8:54 pm
    • Jesse
      Posts: 2

      This is pretty easy, but there are two caveats:

      1) both IK and FK bones have to have the same exact rest position. The base transformation matrices zero at the rest position. If you screw up the rest position of the bones, you will share the fate of the Nazis who opened the arc of the covenant.

      2) it only makes sense to copy IK positions to FK positions, as going the other way around will probably screw up how how the IK solver does it’s thing. But it is trivial to expand this to go the other way.

      You would do something like

      # you need to make sure you are getting pose bones, and not edit bones.
      pBones = bpy.data.objects['Armature'].pose.bones

      # associate the IK bones with corresponding fk bones
      bonePairs = [('aIK','aFK'), ('bIK','bFK'), ('cIK','cFK')]

      for (ik,fk) in bonePairs:
      # assign the ik ‘matrix_basis’, to the fk ‘matrix_basis’
      pBones[fk].matrix_basis = pBones[ik].matrix_basis

      #
      38.1
      Mar 18, 2013 at 12:55 am

Leave a Comment

You must be logged in to post a comment.