Mel Scripting / Expression help!

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  04 April 2008
Mel Scripting / Expression help!


I've created an FK/IK switch for the arm of my character. I used the "Third Arm" script at HighEnd3D. Now, my problem is that while it switches perfectly between the two, for animation purposes, you need to 'snappy' the IK controller over the FK controller for it to appear seamless when it's switched. Right now how it works is the BND arm moves instantly to the FK from the IK when I click from 0 to 1 in my attribute. This is all well and good and all it means is that I have to make another step while animating to make it seamless, but I was wondering if it were possible at all to create an expression in my FKIK attribute that does the work for me. Essentially, when I switch from 0 to 1 on my FKIK attribute, can I create an expression for it that says:

select -cl ;
select -r wrist_CTRL ;
select -tgl L_armIk_CTRL ;
string $selected[] = `ls -sl`;
pointConstraint -n tmpPoint $selected[0] $selected[1];
orientConstraint -n tmpOrient $selected[0] $selected[1];
delete tmpPoint tmpOrient;

How would add this script as an expression so that it does this when I toggle between 0 and 1 in the FKIK attribute?

  04 April 2008

IKFK snapping is an added bonus for created an animator freindly rig. As far as I have known, I have not yet found any rig that provide IK FK snap while blending. It just doesn't make sense. Animators should have a flexibility for easily blending between the two. On the other hand, IK FK snapping is good for quick posing of charater saving a lot of time. So I suggest that you create a simple MEL which is executed each time the file is loaded. To do that you can just create an expression by script Node Name. The snapping is basically done by using Mel commands such as getAttr and setAttr or xform. Then, you can provide a shelf button to quickly execute the snappin process...
  04 April 2008
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:18 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.