PDA

View Full Version : IK Hand Pinning/Space Switching HELP!


BPorter
08-28-2009, 08:53 PM
Hi, what I'm trying to accomplish is here http://www.youtube.com/watch?v=gxusrZiYzbw ... In IK mode, he pins the hand to the head, shoulders, hips, and world space without any popping. Now I did searches for space switching but I can't find anyone who had the same problem as me.

I will explain the way I have it set up, and then you can tell me the way I should have it set up. I have the 2 groups and the controller as follows: Parent|Orient|IK Controller. The parent node gets the parent constraints (head, shoulders, hips). The Orient node gets the world space transformations to avoid popping or movement (this is where my problems are). and then the IK Controller is obviously what the animator uses to animate.

Now I can get it to work if I zero out the IK Controllers translate and rotate values. I don't want to do that because cleaning curves would probably be a pain for the animator.

To get the translation, all I do is get the world space of the IK Controller before the switch (where it needs to be), switch it, get the orient node world space values, then the IK Controller's translate values, subtract the the new IK Controller's values from the original IK Controller's values and set that to the orient node. I hope you got all that! =P

Now the problem is in the rotation because the rotate pivot of the orient node is not in the same place as the IK Controller, so the IK Controller will do more of a revolution rather than spin at the center. I'm sure I'm going about this totally wrong, so I'd appreciate if anyone knows how to accomplish this. Thanks

Leffler
08-29-2009, 09:13 AM
Just a long shot, but have you tried using a point&orient constrain instead of a parent? If Iīm not misstaken, parent constrains work somewhat different with the pivot then an orient does? I might be wrong

For this I use a script from AnimatorFriendlyRigging that works just like in the video, an he uses point&orient so maybe itīs worth a shot

The part in the explaination I didnīt quite understand whas this one:
"
Now I can get it to work if I zero out the IK Controllers translate and rotate values. I don't want to do that because cleaning curves would probably be a pain for the animator.
"

Do you mean the other way around?

Are you using xform? Iīve had trouble with that when freezing transformations

BPorter
08-29-2009, 04:43 PM
Well I just checked out the Blake Rig from highend3d and his script works by just moving the IK Controller to the place where it needs to be in world space. This poses the same problem as me. If you keyed the IK Controller in one space, then key it to another space the frame after, when you look in the Graph Editor there will be a jump in values rather than just cleaning a curve as if it never moved.
Point and Orient wouldn't work because I need translation and rotation to be contrained at the same time rather than separately.

I got an idea of trying to have the Parent|IK Controller group parent constrained under a locator. That locator is parent constrained to all the spaces (head, shoulders, etc..) and keying the offset values. I don't know if that's even possible, but I'll let you know If I figure it out. At least this way I won't have to worry about rotation.

If you figure anything out, please let me know.

Thanks again.

BPorter
08-29-2009, 08:11 PM
Ok I figured out how to do the switch without modifying the values of the actual controller. For those interested, here's how I did it...

Parent Null IK|Ik Controller(to animate with..)
Parent Null Loc|Locator

Parent constrain the Parent Null IK to the locator so that the locator controls the Parent Null IK and IK Controller. Then parent constrain the Parent Null Loc to the different bones (head, torso, hips, etc...)

You would get the world space rotate pivot and world space rotation of the locator before you switch the space.
float $pos[] = `xform -q -ws -rp locator1`;
float $rot[] = `xform -q -ws -ro locator1`;

Make the switch..

Then you would assign those values to the locator after you made the switch.

xform -ws -t $pos[0] $pos[1] $pos[2] locator1;
xform -ws -ro $rot[0] $rot[1] $rot[2] locator1;

This will keep the IK Controller's translate and rotate values the same as if you never made the switch.

CGTalk Moderation
08-29-2009, 08:11 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.