PDA

View Full Version : Request for help - placing polevector ctrl

 Laa-Yosh12-20-2004, 02:29 PMI'm stuck with the following problem... I want to place my polevector control object for an IK limb that is somewhat bent (in a rest pose) so that - it does not affect the rotations on the IK limbs (which are set to 0,0,0 at the moment) - it is positioned at the same height as the knee (or at the same X position as the elbow) First I snapped the control object to the middle joint of the chain, then moved it out a bit along the world Z axis. This, however, did not work as the rotation plane of the joints is usually not aligned to the ZY world plane - I got some tiny rotation offsets on the IK joint chain. So then I've tried pointconstraining the control to the start and end joints so that it gets in the midpoint, and then aimconstraining it at the middle joint of the chain. So far so good. However, our elbows/knees are usually quite far from the middle of the limb (upper arm is usually longer than lower arm, etc), so if I now move the poleCtrl object out a bit along it's aim axis, it'll end up somewhere near the start/end joint, but certainly not aligned to the middle joint. Now, I suppose that simple constraints won't be enough and I'd have to do some math to find the rotation plane of the limb, and then move the control object on that plane... which is way beyond me and my Mel skills. Can anyone help me out in this? Thanks in advance... :)
anthonymcgrath
12-20-2004, 03:32 PM
its prob not the solution everyone will recommend here but I get my armControl object (usually a nurb circle), snap the circle to the end joint of the limb, freeze its transformations. next parent the ikhandle to the circle - this should allow you to move the ikhandle and zero it out by setting the translate of the circle to 0,0,0.
as for the polevector, the ikhandle has a parameter called 'twist' (assuming you've made an RPsolver!). Add an attribute to your armControl nurbCircle called polevector (or similar!) and use the connection editor to link them up. This has a few advantages for me:
-you dont get any slight shift in the arm like you do when you add a polevector constraint

-you can control the objects arm position and elbow point from one node.

-one less object to add to a character set!!

hope this helps :)

ant
toon
uk

12-20-2004, 10:29 PM
On your IK handle, you have values for Pole X, Pole Y, Pole Z. Just move the decimal point for all of those values until your polve vector icon pulls away from your rig. Mulitply by 10 usually does the trick. Then you have the world coordinates of the pole vector handle

Then :
then

I hope this helps.

anthonymcgrath
12-22-2004, 01:42 PM
Hey Danger - thats a class solution too - didn't know you could do that :)
Got any good spine solutions too? What do you think of xsi's spine making facility?

ant
newcastle
uk

unparent
12-23-2004, 01:08 AM
there used to be a script on highend that would do this nicely for you, called buildPoleVector.mel. If it is not there still, I can send it to you.

Basically it would build the pole vector constrained to a locator right in front of the joint in a way that would ensure the joints didnt move. If the locator isnt placed exactly where you want it, you just need to create 2 curves to generate the "plane" that the pole vector would lie on. Then just move your object to the locators position, freeze, and create pole vector. It sounds like a lot of work, but is really very fast once you do it once or twice.

(sorry for the kinda crappy explanation, feel free to contact if you have any questions.)

-unparent

asod
12-23-2004, 10:06 PM

I've scripted the solution so we can have perfect 0 0 0...
now the world is safe again.

//--------------------
// Build Guide Cruve to place the PoleVector node
//--------------------
global proc perfectPoleVector()
{
// Get Select IK.
string \$Ik[0]=`ls -sl -type "ikHandle"`;
if (!`size(\$Ik)`) { print "Select IK First\n"; return; }
string \$StartJoint[0]=`listConnections -d off -s on (\$Ik[0]+".startJoint")`;
float \$StartJointPos[2]=`joint -q -p \$StartJoint[0]`;

// Get IK PoleVector value multiply by 10.
float \$PoleVector[2];
\$PoleVector[0]=(`getAttr (\$Ik[0]+".poleVectorX")`*40);
\$PoleVector[1]=(`getAttr (\$Ik[0]+".poleVectorY")`*40);
\$PoleVector[2]=(`getAttr (\$Ik[0]+".poleVectorZ")`*40);

// Create Curve
curve -d 1 -p \$StartJointPos[0] \$StartJointPos[1] \$StartJointPos[2]
-p (\$PoleVector[0]+\$StartJointPos[0]) (\$PoleVector[1]+\$StartJointPos[1]) (\$PoleVector[2]+\$StartJointPos[2])
-k 0 -k 1 -n (\$Ik[0]+"_PoleCurve");
}// End getPoleVector

Morganism
01-01-2005, 03:40 AM
This is just a thought, I don't know if it would work, but could you parent the PV control under the hip joint, move it in local space to make sure that it stays on the same plane as the joint chain, and then unparent it when you get it where you want it?

asod
01-01-2005, 09:25 AM
parent the PV control under the hip jointIt wouldn't work, let me explain to you what is the PolaVector:
The polaVector is the vector of the ik chain ( all the joint within the ik ). so taking just the first joint orientation isn't going to be on the vector.

Me109
01-04-2005, 06:32 AM
make sure your bone chain is only bent in one axis.. if you have the knee joint kinked in a additional axis...the pole vector will always have this problem... it is best to create the bone chain the front view insuring that the joints are snapped to grid... (create the bones with no primary or seconday orientation too ) then rotate the bone chain from the hip to fit the leg... this is the best way around it.. and you'll achieve excellent IK behaviour too...

Laa-Yosh
01-05-2005, 01:14 PM
Thanks for the various suggestions, guys - it seems that the only real solution is to keep the 3 joints perfectly on a plane (xz, zy etc.). Or maybe we'll try to use a different bind pose and rig pose in the future... whatever.

CGTalk Moderation
01-20-2006, 05:00 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.