Advanced Skeleton / Mgear IKFK Match
- Advanced Skeleton
1.FK to IK
IK控制器去match預先做好的群組(AlignIKToWrist_L),需要match旋轉跟位移,pole則需要使用script計算位置
cmds.spaceLocator(name='PV_Locator')
arm_pos = om.MVector(cmds.xform('Shoulder_L',q=True,t = True ,ws = True))
elbow_pos = om.MVector(cmds.xform('Elbow_L',q=True,rp=True,ws=True))
wrist_pos = om.MVector(cmds.xform('Wrist_L',q=True,rp=True,ws=True))
arm_to_wrist = wrist_pos - arm_pos
arm_to_wrist_scaled = arm_to_wrist / 2
mid_point = arm_pos + arm_to_wrist_scaled
mid_point_to_elbow_vec = elbow_pos - mid_point
mid_point_to_elbow_vec_scaled = mid_point_to_elbow_vec * 2
mid_point_to_elbow_point = mid_point + mid_point_to_elbow_vec_scaled
cmds.xform('PV_Locator',t=mid_point_to_elbow_point)
PV_Locator_t = cmds.xform('PV_Locator',q=True,ws=True,t=True)
PV_Locator_paste = cmds.xform('PoleArm_L',ws=True,t=[PV_Locator_t[0],PV_Locator_t[1],PV_Locator_t[2]])
cmds.delete( 'PV_Locator' )
cmds.select(clear = True)
利用SK_Shoulder、SK_Wrist算出中點,再將中點與SK_Elbow連起來的線便是Pole的位置
2.IK toFK
估計是利用IKSystem中IKJoints內的IK骨頭去對位,只需利用xfom去查詢IK骨頭旋轉的世界座標資訊,再貼給FK控制器即可
- Mgear
IKFK切換全是使用預先建立的群組(arm_L0_ik_mth)定位,但Mgear內建就有無縫切換
最後,無縫切換在做切換時,若不想被自己設Key就需要先把AutoKey關閉,即可避免Maya自動設置一堆不必要的Key