I was looking at some earlier projects that I did and I noticed that over the years I’ve actually rigged a dog leg in quite a few different ways. So I decided to make a quick video demonstrating how you use 3 different methods to set a up a reverse leg.

Of the three, number 3 is by far my favorite because I think it gives you the most flexibility as an animator. And as a rigger, it’s pretty straight forward to set up.

Apologies if the audio quality isn’t the best, I recorded this early in the morning :)

Here’s the little script I used to create a locator and set it at the correct position in world space for the pole vector:

import pymel.core as pm

def get_pole_vector_position(joint_1, joint_2, joint_3, multiplier=1.0):
    # http://lesterbanks.com/2013/05/calculating-the-position-of-a-pole-vector-in-maya-using-python/
    a = joint_1.getTranslation(space="world")
    b = joint_2.getTranslation(space="world")
    c = joint_3.getTranslation(space="world")

    start_to_end = c - a
    start_to_mid = b - a

    dot = start_to_mid * start_to_end

    projection = float(dot) / float(start_to_end.length())

    start_to_end_normalized = start_to_end.normal()

    projection_vector = start_to_end_normalized * projection

    arrow_vector = start_to_mid - projection_vector
    arrow_vector *= multiplier

    pole_vector_position = arrow_vector + b

    return pole_vector_position

joint_1, joint_2, joint_3 = pm.selected()

locator = pm.spaceLocator()
locator.setTranslation(get_pole_vector_position(joint_1, joint_2, joint_3), space="world")