AutoRigging: IK Pole Vector
Updated: May 21, 2021
In this week's Tech Art Tuesday I want to share my own approach to creating pole vectors for an IK joint chain.
Pole vector controls can't be placed randomly; if they are not 100% aligned with the IK Handle it will cause the IK chain to rotate out of place.
One way to figure this out manually is to make a triangle using the Create Polygon tool and placing one vertex in each IK joint. In vertex mode, select the middle vertex and translate it outwards using Axis Orientation = Normal (found in Translate Tool settings). The distance is up to your preference, as long as that vertex remains aligned with the plane of this triangle.
This gif demonstrates the importance of aligning your Pole Vector with the plane described by the IK Handle:
(Notice how the badly-placed controls cause the chain to rotate out of place)
We can automate this process with code! Here's a class function from my personal auto rigger that uses the same principle (I used a curve instead of a plane though, because it's easier to query control vertex info).
I comment my code a lot because I'm very forgetful. In a studio scenario I'd try to make it more concise lol
The bright side is, the breakdown is pretty much in the script itself already. Here as a few extra notes:
1) My personal auto rigger is "modular", and each module contains a class (Arm Rigging Module = Arm_AutoRigger.py, Spine Rigging Module = Spine_AutoRigger.py).
This method is inside the AutoRigger_Masterclass.py, which contains all the most basic methods, like creating pole vectors, compensating controls etc. The other modules all inherit this class.
2) The jntChain argument is the IK chain we're making this pole vector for.
3) limb is a string prefix to make the output more organized and clean <3
4) I like to add print statements at the end of each method because it makes it easier to troubleshoot later.
5) I've seen auto riggers that do not translate the pole vector control at all (the tech animator/artist is the one who places the control manually later). That's cool too! In my case, because I decided to automate it, I'd give the user an input to control the pole vector distance.
That's it for this week!