Home » Appendix 2 @9:26 FK to IK arm switching

Appendix 2 @9:26 FK to IK arm switching

Maya Learning Channel | Appendix A: Part 1 – Matching the FK arm to the IK arm

In Appendix 2 @9:26 both of my FK to IK arms switching is not working but everything else is. Below are examples of the outcome.

Judging from these worldspace queries, I my controls do not appear to be frozen yet they are and must have been moved after being frozen to give it these readings.

xform -query -worldSpace -rotation leftArm_CTRL;

// Result: 0 0 0 //

xform -query -worldSpace -translation leftArm_CTRL;

// Result: 0.695788 4.453783 0 //

 

Solution:

As stated by Maya Learning Channel in an answer to Gamerwhogames I applied this code:

For the leftArm_CTRL find :

$t_hand = `xform -query -worldSpace -translation rightArm_IK_snap_GRP`;

 

and Replace with:

 

$t_hand = `xform -query -worldSpace -translation leftArm_CTRL`;
$t_rp = `xform -query -worldSpace -rotatePivot leftArm_IK_snap_GRP`;
$t_rp2 = `xform -query -worldSpace -rotatePivot leftArm_CTRL`;
$t_hand[0] += $t_rp[0]-$t_rp2[0];
$t_hand[1] += $t_rp[1]-$t_rp2[1];
$t_hand[2] += $t_rp[2]-$t_rp2[2];

For the rightArm_CTRL find :

$t_hand = `xform -query -worldSpace -translation rightArm_IK_snap_GRP`;

 

and Replace with:

 

$t_hand = `xform -query -worldSpace -translation rightArm_CTRL`;
$t_rp = `xform -query -worldSpace -rotatePivot rightArm_IK_snap_GRP`;
$t_rp2 = `xform -query -worldSpace -rotatePivot rightArm_CTRL`;
$t_hand[0] += $t_rp[0]-$t_rp2[0];
$t_hand[1] += $t_rp[1]-$t_rp2[1];
$t_hand[2] += $t_rp[2]-$t_rp2[2];

 

 

 

Example before:

The left arm posed with the FK controls

Above: The left arm posed with the FK controls.

 

Example after:

The left arm after IK switch

Above: The left arm after IK switch via MEL script UI.

 

Shopping Cart