PDA

View Full Version : Make an IK arm work like FK


TechnicallyArtistic
07-20-2004, 11:16 PM
So I'm building a fairly complicated rig right now. Like decked out with arm twist, scaling/squash and stretch per a joint, reverse boin chain, cluster driven spline Iks all over it, type stuff, and I'm trying to make it so the legs and arms kinda work like FK. At least for any reason I would want to switch them back to FK.

So what I have right now, on the arm for example, is esentialy a chain of joints for the arm, an RP IK solver on them to make it bend, and a pole vector constraint for the elbow. The IK handel has a controler parented above it. What I really need to make this work the way I want is one pivot point for translating and another for rotation, but since translate and rotate have the same one (why they tthought it was a good idea to give only scale it's own, I have no idea) I need to do the rotations with a seperate node. So I know theres the whole translation matrixy thing there in the order, but here's what I've been tryying to work on so far.

What I've been trying to do, is I figure I can group the control to it's self and then place it's pivot point on the elbow. The problem we run into here is that since it's the parent of the control, you translate the control, the elbow moves, but the groups pivot point stays in place. So it doesn't stick to the elbow. What I need is some kind of script that will update the pivot point of the group to the elbow, but only when it's selected. What I've tried so far in various ways are constraining or parenting a locator to the elbow, then trying to tell the group to update it's pivot point to the elbow. I've been trying this following expression, as well as others along this line:

string $selection[] = `ls -sl`;
float $posA[] = `xform -query -worldSpace -rotatePivot rt_elbowLOC`;
float $posB[] = `xform -query -worldSpace -rotatePivot rt_armPivotGRP`;
if( $selection[0] == "rt_armPivotGRP" )
{
$posB[0] = $posA[0];
$posB[1] = $posA[1];
$posB[2] = $posA[2];
}


So here, I'm looking at what's selected, if it's the group, then it should run the script, and take the world space for the rotatePivot of the locator and input it into the world space for the group node. But when ever I try this and move the arm, the pivot point of the group just stays in place.

Also, I know for this to work right, the elbow control, controling the pole vector of the elbow needs to snap to the elbow when we're rotating the group, so that the elbow doesn't float around, and then preferably snap back once you go back to the control. That one isn't so tricky, because of its set up. It's not trying to drive something it's driven by.

On top of that, I'm not even sure that thhis will work right once it's animated, since the parten of the contol has it's pivot point floating all over the place. Though that might be canceled out if I set up an expresion that says when ever I key frame the controler, that it key frames the group as well, or something like that.

If i could, i'd just try to figure out some way to simply make a parent hyerarchy, but I can't find a way to do it without creating a dependancy loop. Another tricky part about that, is I have to make sure the group is initialy oriented the same way as the arm, so that when it's rotated it's bending with the elbow, rather than breaking it.

Very important note too, is that the joint squashes and stretches, so it's need to some how specificaly stay on the elbow, even if the proportions of the arm change.

So, if anybody has any ideas on how to make that work, or any alternative ideas to basicaly rotate at the elbow, it'd be a big help.

schock
07-23-2004, 02:56 AM
What you are trying to do Animanium does like a dream. It blends IK and FK seamlessly on every control. In maya there is no clean or easy way to make a parents pivot follow its child. It goes agains mayas internal structure. There is a hidden IK in maya that has this kind of capability but it is kind of buggy and isn't fully supported which is why it isn't visible in the UI. Expressions are dirty and will only update continuously if they are connected to a attribute which is currently being updated. And like you said an animated pivot will get messy. You can just make a couple constraints that flip when you chang controls and have a script match positions and rotations for you but again this is also kind of messy. There is a really cool plugin at highend called Bidirectional Constrain that tricks maya into letting two objects have control of eachother. So good luck with that but ask yourself if this kinda control is really necessary. The best motion usually comes from concise controls an animator finds simple to use.

Schiller

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