0

If you create a pole vector constraint for ik in Maya, you can see that the locator and joint 1, joint 2, and joint 3 should be on the same plane. simple ik controller with pole vector constraint

This can also be verified by the following code

import maya.cmds as mc
import json, os, sys
import numpy as np

def gwp(obj_name):
    return cmds.xform(obj_name, q=True, ws=True, t=True)


def judgeSamePlane(p, plane_p):
    first = plane_p[0]
    second = plane_p[1]
    third = plane_p[2]
    normal_vector = np.cross(second-first, third-first)
    normal_vector = normal_vector/np.linalg.norm(normal_vector)
    target_vector = p - first
    target_vector = target_vector/np.linalg.norm(target_vector)
    print(np.dot(normal_vector, target_vector))

fp = []
fp.append(np.asarray(gwp("joint1")))
fp.append(np.asarray(gwp("joint2")))
fp.append(np.asarray(gwp("joint3")))
print("from_plane", fp)

tp = np.asarray(gwp("locator1"))
print("target_point", tp)

judgeSamePlane(tp, fp)

But in an ADV binding obtained from someone else, the locator and joint do not seem to be on the same plane

For example, for the hip-knee-ankle joint chain, when I only move the corresponding locator, they still satisfy a coplanar relationship. only move locator

But if I move the ik controller at the ankle, then the locator and hip-knit-ankle will no longer be coplanar, which is not very consistent with my understanding of pole vector constraints. move ankle ik controller

Can anyone tell me where the error occurred or where my understanding was incorrect? Thank you very much!

nkoo0
  • 3
  • 1

0 Answers0