Void OnAnimatorIK() is not being called

void OnAnimatorIK(int layerIndex) //Basically is not called
{
    print("Animator works?"); //desn't print anything
    if (animator)
    {
        for (int i = 0; i < joints.Length; i++)
        {
            Vector3 jointRotation = joints[i].rotation.eulerAngles;
            jointRotation.x = Mathf.Clamp(jointRotation.x, -maxRotationAngle, maxRotationAngle);
            jointRotation.y = Mathf.Clamp(jointRotation.y, -maxRotationAngle, maxRotationAngle);
            jointRotation.z = Mathf.Clamp(jointRotation.z, -maxRotationAngle, maxRotationAngle);

            joints[i].rotation = Quaternion.Euler(jointRotation);
        }
        print("last rot: " + joints[joints.Length - 2].rotation); // still desn't print anything
    }
}

I have Ik pass enabled, but no animation clips. I tried putting some empty animations, but still nothing.
Can anyone explain to me why is it not working? The documentation isn’t very clear about it.

Perhaps some answers here?

Sorry, I didn’t mention that is for a non humanoid character. At any case, I find it hard to understand what they were saying in that post. It says that “the script with IK needs to be attached to the gameObject with the Animator”, but the chain IK Constraint (that I am assuming is the script) needs to be on the empty child of the empty child of the object with the Animator (or at least I could only make it work with that configuration). If, instead of that, the quoted sentence means that the script with OnAnimatorIK() needs to be on the same gameObject that has the Animator, well… I tried that as well. And I’m still here.