PDA

View Full Version : Some move commands need to be executed twice


GeoffClark
05-15-2010, 02:16 PM
Hi there,
I'm making an IK/FK matching script node. It is a script node that makes the FK chains match the IK ones, and visa versa. The script portion of the switch from FK to IK didn't work at all, the arm didn't match up, until I executed the movement commands twice. It then matched up fine.

Here's the code:

else if ($q == 2) // 2 = matchFK
{
setAttr ("lf_armConfigCTRL.lf_arm_IK_FK") 0; //sets the IKFK switch to IK mode
$posIK = `xform -q -ws -rp ("lf_handDummyLOC")`; // Get the worldspace position of hand dummy

$EposIK = `xform -q -ws -rp ("lf_elbowDummyLOC")`; //Get the worldspace position of elbow dummy
move -rpr $posIK[0] $posIK[1] $posIK[2] ("imho_lf_armIK_CTRL"); //move the IK arm CTRLer to where the hand dummy is
move -rpr $posIK[0] $posIK[1] $posIK[2] ("imho_lf_armIK_CTRL"); //move the IK arm CTRLer to where the hand dummy is

move -rpr $EposIK[0] $EposIK[1] $EposIK[2] ("imho_lf_elbowCTRL");
move -rpr $EposIK[0] $EposIK[1] $EposIK[2] ("imho_lf_elbowCTRL");

}

I don't know why; anybody have some ideas? I'd hate to leave that noob hack in there for others to see...

Thanks

CGTalk Moderation
05-15-2010, 02:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.