How to connect MEL code to custom Enum Attribute

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  10 October 2012
Smile How to connect MEL code to custom Enum Attribute

I basically developed IK-Fk script and i want that to be executed depending on whether IK or Fk selected on enum attribute given to a nurbsCircle, How that would be possible in Maya?
 
  10 October 2012
I guess you could have a script node running that would check if that object is selected and then run a proc when the value is changed. Seems a bit like overkill to me though, why not just have shelf button or hotbox command that looks at what the animator has selected and does the appropriate proc instead?

Cheers,
Brian
 
  10 October 2012
Thanks for reply Horganovski,
I basically want to integrate script within .ma or .mb file so that i dont have to carry .mel files along. Script nodes like you said, would be awesome. I don`t want the script to iterate all the time.
But i want that to run once whenever i swith between options. wondering whether scriptNode work that way or iterate all the time.
 
  10 October 2012
Script nodes can be run on file open. So what you can do in your case is have your scriptNode create a scriptJob that monitors the nurbsCircle enum attribute and fires your script whenever it changes. Set that script node to run on file open and I believe you should be set.

Note that the real problem with script nodes is that it's very static. If you later want to add another nurbsCircle to monitor, you'll need to update the script node script to accomodate that new object. So you basically need another script to maintain your script node. It quickly gets unwieldy which is why Horganovski is suggesting a simpler/manual approach.

Last edited by Keilun : 10 October 2012 at 06:26 PM.
 
  10 October 2012
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 08:14 AM.


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