So this is what I got so far:
import maya.cmds as cmds
import maya.OpenMaya as om
#select the joints you need
sel = cmds.ls(sl=True)
#assign selection
fkwrist = sel[0]
fkelbow = sel[1]
fkshldr = sel[2]
ikwrist = sel[3]
ikpv = sel[4]
#get position from fk
fkwRaw = cmds.xform(fkwrist, ws=True, q=True, t=True)
fkwPos = om.MVector(fkwRaw[0], fkwRaw[1], fkwRaw[2])
fkeRaw = cmds.xform(fkelbow, ws=True, q=True, t=True)
fkePos = om.MVector(fkeRaw[0], fkeRaw[1], fkeRaw[2])
fksRaw = cmds.xform(fkshldr, ws=True, q=True, t=True)
fksPos = om.MVector(fksRaw[0], fksRaw[1], fksRaw[2])
#Set position of the IK wrist ctrl
cmds.move(fkwPos.x, fkwPos.y, fkwPos.z, ikwrist)
#start figuring out pv position
#find avg (midpoint of shoulder and wrist)
midpoint = (fkwPos + fksPos) / 2
#find pv direction
pvOrigin = fkePos - midpoint
#extend that length
pvRaw = pvOrigin * 2
#position pvRaw at midpoint
pvPos = pvRaw + midpoint
#stick pv at pvPos
cmds.move(pvPos.x, pvPos.y, pvPos.z, ikpv)
Everything works except for the wrist rotation/orientation. As far as I can see the problem revolves around the fact that ik wrist offset node does not match the fk wrist offset node when i execute this script…(my offsets are the ones with rotations, controls within them are clean). I am not sure how to go about fixing that. If I can make it so that the IK wrist ctrl gets the same rotations as FK wrist ctrl at the end, the script would be perfect
Any help would be appreciated