/*
Script Node execute on:Open/Close
*/
$left_scriptJob =`scriptJob -ac IKFK_cv_ctr.IKFK IKFK -cu 1 -pro`;
global proc IKFK()
{
float $an=`getAttr IKFK_cv_ctr.IKFK`;
//------------------Change to IK----------------
if(0 == $an)
{
float $fkjnt3t[] = `xform -q -ws -t FK_jnt_3`;
xform -ws -t $fkjnt3t[0] $fkjnt3t[1] $fkjnt3t[2] IK_cv_ctr;
float $fkloc[] = `xform -q -ws -t FK_loc`;
xform -ws -t $fkloc[0] $fkloc[1] $fkloc[2] IK_loc;
}
else
{
//------------------Change to FK----------------
float $ikjnt1rx = `getAttr IK_jnt_1.rx`;
float $ikjnt1ry = `getAttr IK_jnt_1.ry`;
float $ikjnt1rz = `getAttr IK_jnt_1.rz`;
setAttr "FK_jnt_1.rotateX" $ikjnt1rx;
setAttr "FK_jnt_1.rotateY" $ikjnt1ry;
setAttr "FK_jnt_1.rotateZ" $ikjnt1rz;
float $ikjnt2ry = `getAttr IK_jnt_2.ry`;
setAttr "FK_jnt_2.rotateY" $ikjnt2ry;
}
}