View Full Version : wrist follow/not follow IK arm setup - switch? need help asap :/

11 November 2010, 12:38 AM
hey guys,

so hopefully, you can help me once more...

I've ot a rig I'm supposed to hand in 12 hours. One thing the animator requested is a switch (im thinking an attribute on something) for whether the ik wrist controls follow the body or not..

You all know it, basically I need to find out, how to make the wrists follow with the rest of the body when i want, and when i switch the attribute, to have them separate, much as the feet controls usually are.

Let me please know what do you think...

What I tried is parent constrain it to the shoulder control, for when it moves with the body, and parent constraint it to the primary control of the whole char, for when it moves freely (got an att set up through reverse node, controlling the weights of the constraint), but the thing is, the constraints always remember where they were in the time of creation, so the problem is, that if i move the wrist control, and switch to the other constraint it jumps back to the original position, i need it to stay where it is, just to change it's behavior...

Sorry for the long post, hope someone understands what i need and is able to help... Please ...

11 November 2010, 04:12 AM
From the tutorials I've seen, one way to do what you want is to have two control objects at the wrist-- the one control object that the IK chain is linked to... and a second control object that has the inherit rotations turned off (On the Link Info Tab)... then you create expressions to have the hand either inherit the arm rotations and follow the forearm or not. There may be more current tutorials out there but this one:

"Character Rigging" by Sergio Muciņo

explains this method (it's somewhat dated... but I think still applicable to what your looking to do)... I hope it helps.

Just do a Google search and it should show up as the first hit... not sure why it's deleting the domain portion of the link when I try and post you the direct link to it.

Good luck.


11 November 2010, 11:11 AM
Thanks mate, it's highly appreciated. will check it out asap. I had to hand it in without this :/

11 November 2010, 06:46 PM
You could make a group that has your control object in it, and then parent constrain that to the chest or hip controller of your character. then you can make your switch the blend weight of the constraint. I feel like I might be missing a step as im doing this from memory so let me know if something goes wrong and I will make a maya scene for you.

11 November 2010, 07:40 PM
Hey Michael, thanks for the input, im concerned tho, as i stated above, i tried parent constraints, the thing is if i blend - switch, the wrist would move, since the object would not be following the exact location of the wrist at the moment (unless i point constrained it to the wrist, at which point, along with the parent constrain to the same object from the wrist, it would create a cycle and we all hate those..).

I'm looking for a way of seamlessly switching between hand following and not following and would rather use a slide of some sort, than script, which kind of hard-codes it, cuz here's what i came up with this afternoon:

two locators,

both parented under shoulder control, both point and orient constrained to the wrist, so they are always in the exact same location as the wrist, one has the inherit transforms turned of, so the values it has are world-coord, one has them turned on.

Now i wrote a script, that in case i set my switch atribute "ik wrist follow" to "on" (got enums there) it stores the values of the inherited locator, turns inherit on the wrist CON on, and pushes the stored values into it.
when it switches to "off" pretty much do the same, the other way around.

With this way tho, it would make kinda hard going through curves in the graph and animating by curves, im worried it would make more problems than use, so I'd rather use more kind of an animation friendly method..

If what you had in mind follows my request, i'd be more than happy and very glad if you could stitch up a scene for me there..

Thanks mate

11 November 2010, 07:40 PM
sorry about that. You are correct, the way that I mentioned wouldnt handle all of the things that you need. I am intrigued by this and will try to play around with it some tonight.

11 November 2010, 08:26 PM
same here! i cant let it our of my head :) no matter what i try, i always end up with a cycle of some sort, if i want to use constraints. Got already about 5 papers lying around me with different scenarios sketched, heh..

Let me know how it turnes out and good luck! :)

P.S. I just thougt of somethin, but am unable to try it now, maybe it will serve you in your endeavors.

FYI, the way i set up all my controls is like this:
lf_wrist_IK_CON grouped in lf_wrist_IK_CON_SDK grouped in lf_wrist_IK_CON_0

so basically a control grouped twice. so here's my idea:

have the same setup as my last post, two locators, one inherit on, one off, but this time, thay are point and orient constrained to the lf_wrist_IK_CON_0 group. with which the animator doesn't move at all anyways. So...

When the script runs, have it key the inherit obviously, and hav it key the position of the lf_wrist_IK_CON_0. That way, the transforms on the CON itself, would stay the same, but no longer follow the rotations of the body.

the script i think could go with it is as follows (no keying in it yet):

(note that "lf_arm_IK_FK_blend" is the object im using to switch, and "IK_wrist_follow" is the attr used to do that, which is an enum)

if (`getAttr "lf_arm_IK_FK_blend.IK_wrist_follow"` == 1 ){

//first store the values of the local locator:
$wristProperRotate = `getAttr "lf_wrist_inherit_on_loc.rotate"`;
$wristProperTranslate = `getAttr "lf_wrist_inherit_on_loc.translate"`;

//turn on inherit rotations
setAttr "lf_wrist_IK_CON_0.inheritsTransform" 1;

//set the right attributes to the _0
setAttr "lf_wrist_IK_CON_0.translate" $wristProperTranslate[0] $wristProperTranslate[1] $wristProperTranslate[2];
setAttr "lf_wrist_IK_CON_0.rotate" $wristProperRotate[0] $wristProperRotate[1] $wristProperRotate[2];

if (`getAttr "lf_arm_IK_FK_blend.IK_wrist_follow"` == 0){

//first store the values of the world locator:
$wristProperRotate = `getAttr "lf_wrist_inherit_off_loc.rotate"`;
$wristProperTranslate = `getAttr "lf_wrist_inherit_off_loc.translate"`;

//turn off inherit rotations
setAttr "lf_wrist_IK_CON_0.inheritsTransform" 0;

//set the right attributes to the _0
setAttr "lf_wrist_IK_CON_0.translate" $wristProperTranslate[0] $wristProperTranslate[1] $wristProperTranslate[2];
setAttr "lf_wrist_IK_CON_0.rotate" $wristProperRotate[0] $wristProperRotate[1] $wristProperRotate[2];


The only downside to this, is if the animator decides to tweak or go back with this setup, there will be a key on the _0 and basically on a lot of things, that won't be at his disposal, thus trouble.

The best way is probably having two controls for the wrist (one parented normally under shoulder, one under the primary control), and parent constraint it between each other. I saw that somewhere... Looks legit.

Sorry for the longest post ever (by me, haha..)

Lemme kno :)

CGTalk Moderation
11 November 2010, 08:26 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.