david | animation,mel script,opinions | Monday, June 18th, 2007


When I'm rigging a character in maya I generally use some kind of auto rigging system. My current preference is Hamish McKenzie's zoo toolbox (zooCST). This means that things pole vector constraints are created for me. Recently I was helping Jeremy rig something where the auto rigger just didnt seem appropriate. When we got to adding the pole vector constraints, Jeremy asked why we couldn't just put the control objects where we wanted them. He was getting frustrated because the joints would rotate when he added the constraint.

With zooCST I knew how to put a control object at the exact location that would not cause this rotation, but my collegue insisted that we should be able to just place the control object where we wanted, click a button and let maya figure out how to keep the joints in place.

After some searching I found a little mel script on highend3d called nilsNoFlipIK.mel (written by Nils Lerin). It lets you specify a vector and an ik handle and it calculates the twist value required to keep the joints from rotating. Since the ikHandle.twist can be calculated for a given vector, I just needed to figure out how to calculate that vector from the location of the control object.

The result is djBuildPoleVector.mel.

Download djBuildPoleVector.mel and nilsNoFlipIK.mel (both are required). Put them both in your scripts folder.

Select a control object and an ik handle and type djBuildPoleVector

A pole vector constraint is created, the ikHandle.twist attribute is set and there is no joint rotation.


  1. you can use the "zooFindPolePosition" script in zooVectors.mel that comes with zooCST. the zooFindPolePosition function actually just calculates the position of the pole vector, it doesn't create anything for you. but it has a bunch of useful options. :)

    Comment by macaronikazoo — September 18, 2007 @ 2:26 am

  2. Hey Hamish. Thanks for dropping by.
    Rereading my post now, I probably could have worded it better. It almost looks like I was saying zooCST was not up to the task at hand. Not true at all. In actual fact I was helping someone learning the basics of ik, and this question about the pole vector came up. So djBuildPoleVector was more about leaning how stuff works than something I would use every time - I don't actually like the way it leaves you with a non-zero twist value in the ik handle.
    I have used “zooFindPolePosition” script within the zooCST and that would still be my first choice.

    Comment by david — September 18, 2007 @ 11:09 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck