# Why is Blender's IK pole target system so difficult? Am I missing something?

I'm accustomed to doing my rigging in Maya. I enjoy the precision and the constraint system is excellent.

I decided to broaden my horizons. Now the rage:

Over the past day and a half i've been messing with Blender's IK system and found it to be terribly bad. The pole target system flips my IK unless I make some pole angle adjustment. I already know how to set up the pole target so my rig doesn't twitch, that's not the problem. The problem is aiming my IK at the pole target WITHOUT having to touch the pole angle. The only way to achieve this is with a bone roll setup that hasn't been adjusted at all.

How in the hell do you guys do this? Is there some addon i'm missing?

• I was able to make a no-flip knee by also adding the Locked Track constraint. I don't know what this is exactly for, but it works. – allen Jul 29 '15 at 7:39
• Blender's rigging system is finicky to say the least. Its pole target system in particular is very bad. But Blender is ever-growing and (hopefully) there will be an option in the future to aim at a pole target by axes. Good animation can still be done, but if an IK is giving you grief, delete it and simply do the bending-joints animation manually. It doesn't take that much more effort. – allen Jul 30 '15 at 5:30

You are trying to do impossible. Check this out how Pole target angle is exactly computed and how the IK works with it.

You either setup the pole angle or the IK base bone roll.

Adjusting the pole angle is lesser evil, that's how it should be done. Adjusting bone roll ends up in re-binding skin.

Maybe the iTaSC IK solver would suit better your application than the blender's legacy one, try it out.

• @R.Navega bone roll changes the edit bones so it changes the base pose. And if there is a mesh already bound to the bone, so it changes how it is bound. You can control the pose of Pole bone how ever you want, but I don't think this changes anything on the matter. You can have it free floating, parented to IK Control, parented to "guide bone", etc. – Jaroslav Jerryno Novotny Nov 23 '17 at 10:15
• @R.Navega It should be usually rigged how the animator wants it, but if I am animating I prefer Pole bones parented to their IK targets and those parented to the armature Root bone, that suits me:) Some animators prefer free floating. – Jaroslav Jerryno Novotny Nov 24 '17 at 8:35

I came to a solution after much grief. I hope anyone else having hell with this situation finds this useful.

I rebuilt the rig and discovered that there was no problem at all with the pole vector constraint. The problem is that in my previous attempt I was using the Rigify addon, and I suspect I was running into double transforms.

If your problem is to avoid the mesh deformation so ...

After setting yout bones contrainst, j ust go to pose menu / pose/apply /apply pose as rest pose

You may want to try this: http://pasteall.org/384523/python

It's an addon. You'll have to put it in your %appdata%\Blender Foundation\Blender\2.78\scripts\addons folder or the equivalent in your platform and enable it in Blender. It adds a button to the constraints panel for each IK constraint it finds. The button puts the right number in the pole angle box.

I took @jerryno's solution and coded an addon around it, so, thank him. It's not the most elegant solution around, but it did the trick for my pipeline.

EDIT: as pointed out in the comments, I'm inserting the code inline so it stays here once the pastebin turns to dust.

bl_info = {
"name": "Bone Panel extension",
"author": "Fernando D'Andrea - Rockhead Studios (thanks to Jerryno for the angle calculation code)",
"version": (0, 1),
"blender": (2, 78, 0),
"location": "Properties > Bone Constraints > Inverse Kinematics",
"description": "Extends IK panel funcionality",
"warning": "",
"wiki_url": "",
"category": "Rigging"
}

import bpy
import mathutils
import bmesh

def dandrea_IKConstraint_panel(self, context):

_bone = context.pose_bone #context.object.pose.bones
#self.layout.label(str(_bone.name))
#self.layout.label(str(_bone.constraints))
#self.layout.label(str(len(_bone.constraints)))
for cons in _bone.constraints:
if cons.type=='IK':
self.layout.operator("constraint.dandrea_adjust_pole", icon = 'OUTLINER_OB_ARMATURE', text='Adjust Pole Angle:    ' + _bone.name + ' ("'+ cons.name +'")').constraint = cons.name

"""Adds functionality to the IK constraint panel."""
bl_label = "Adjust IK Pole Angle"
bl_icon = 'OUTLINER_OB_ARMATURE'
constraint = bpy.props.StringProperty(name="IK Name", description="IK constraint name to set", default="")

@classmethod
def poll(cls, context):
#implement poll
return True

def execute(self, context):

def signed_angle(vector_u, vector_v, normal):
# Normal specifies orientation
angle = vector_u.angle(vector_v)
if vector_u.cross(vector_v).angle(normal) < 1:
angle = -angle
return angle

def get_pole_angle(base_bone, ik_bone, pole_location):
return signed_angle(base_bone.x_axis, projected_pole_axis, base_bone.tail - base_bone.head)

context_mode = context.mode
bpy.ops.object.mode_set(mode='POSE')
ik_bone = context.pose_bone
print (ik_bone)
cons = ik_bone.constraints[self.constraint]
if cons is None:
return {'CANCELLED'}
cons_mute = cons.mute
base_bone = ik_bone
for i in range(1, cons.chain_count):
base_bone = base_bone.parent
if base_bone is None:
return {'CANCELLED'}
pole_bone = cons.pole_target
if pole_bone is None:
return {'CANCELLED'}
if pole_bone.type == 'ARMATURE':
pole_bone = context.object.pose.bones[cons.pole_subtarget]
if pole_bone is None:
return {'CANCELLED'}
print(pole_bone)
if (base_bone is not None) and (pole_bone is not None):
cons.mute = False
bpy.ops.object.mode_set(mode='EDIT')
print(pole_angle_in_deg)
cons.mute = cons_mute
bpy.ops.object.mode_set(mode=context_mode)

return {'FINISHED'}

def register():
bpy.types.BONE_PT_constraints.append(dandrea_IKConstraint_panel)

def unregister():