PDA

View Full Version : Best way to move ik handle effector?


jgibz
05-23-2006, 05:09 AM
Hi everyone,

I'm writing a script that creates a biped rig. In the section responsible for setting up the arms there appears to be a bug...

The script is designed to setup the ik handles on the arms from the shoulder to the first forearm joint(the script works on arm chains with 3 forearm joints). This way the effector can be moved to the wrist, allowing the animator to rotate the forarm joints.

here's the code...

float $wristPosition[] = `xform -q -ws -rp $wrist`;
string $handleResults[] = `ikHandle`;
select $handleResults[1];
move $wristPosition[0] $wristPosition[1] $wristPosition[2] ($handleResults[1] + ".scalePivot")

Does this look like it will cause problems?

The reason I think it's a bug is because sometimes the script places the effector in the right place. But most times it's wrong, placing the effector on the first forearm joint, bending back the ik chain. (this is a 3 chain ik/fk arm setup).

here are a couple of pics to illustrate what I'm talking about...
http://www.unm.edu/~jgibz/desired.jpg
http://www.unm.edu/~jgibz/problem.jpg

Anyways, if this isnt enough information, here's the file where this exists.
http://www.unm.edu/~jgibz/jgFinishRigArm.mel

Thanks for any help
-j

isoparmB
05-23-2006, 06:19 AM
float $wristPosition[] = `xform -q -ws -rp $wrist`;
string $handleResults[] = `ikHandle`;
setAttr ($handleResults[0] + ".snapEnable") 1;
setAttr ($handleResults[0] + ".stickiness") 0;
select $handleResults[1];
move $wristPosition[0] $wristPosition[1] $wristPosition[2] ($handleResults[1] + ".scalePivot");


Try the previous.

jgibz
05-23-2006, 01:56 PM
Thanks for the reply isoparmB,

I tried adding those two lines, and when I first ran the script it worked. I ran it again and sadly the problem reappeared :(

isoparmB
05-24-2006, 01:02 AM
Hmmm..... that is odd. Make sure you are entering the right arguement for : string $Wrist in your proc. You could be entering the wrong joint when you call it, which might be your problem.

If that dosen't help, you could execute the script line for line to see if there is any kink in the workflow you've just scripted. You could execute it in the joint scenarios that you're having a problem with, that way you'll be able to isolate which part of the code is not working right. It's tedious, but effective.

Could you also check to see what your IK's setting for Snap Enable and Stickiness are after executing the script? I'm just curious. I've tried doing it manually in a simillar scenario as illustrated on your jpeg, and the technique seems fine.

CGTalk Moderation
05-24-2006, 01:02 AM
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.