View Full Version : Set curve to execute command...
Huitt 05-13-2008, 04:47 PM Hi,
I'm working on a curve gui in Maya. I want to create a curve that, on selection, executes a command. What I want it to do is simply zero out another curve, but I am unsure how to make the curve selection act as a 'button'. Someone suggested "selectionChange" but I am unable to find information regarding this topic.
I would also like to make the selection of a curve place a blend shape at a certain value ( I know how to control the blend shape with translation of a curve through SDK's, but not selection alone...), though I should be able to figure that out if I can get the other.
Thanks in advance...
|
|
edwardG
05-13-2008, 10:09 PM
This would work much better if you were to create a GUI in combination with MELscripting. Then you could actually create buttons that would do what you want. If you can find it, pick up "The Art of Rigging" Volume 1 and they guide you through creating a custom UI with MEL.
Another solution which would be a little more simple would be to create simple scripts and save them to your custom shelf. It's fairly easy to figure out, as you just have to open up the script editor and copy the MEL directly from Maya onto your shelf.
Huitt
05-14-2008, 12:42 AM
I know how to do most of that but what I'm trying to do is find a way to make a readily accessible window to coincide with a gui created from curves, something that is usable from 3d space, without having to open an additional window. It's for extra credit (and personal knowledge) or I would just do a separate window.
Thank you for the advice though. It is greatly appreciated.
NPuetz
05-14-2008, 03:42 PM
Hello fellow Full Sailer. What your looking for is a scriptJob utilizing the "Selection Change" event. So basically...
-----------------------------------------------------------
global proc abc_runCommand()
{
...command code...
}
scriptJob -e "SelectionChanged" abc_runCommand;
-----------------------------------------------------------
You'll want to put what ever commands you want to run when the curve is selected into a procedure and than create that scriptJob using the "SelectionChanged" event in which will call that procedure when ever your selection is changed. And if you want it to only run when a specific curve is selected, than in your procedure just put an if/switch statement in there to test if the current selection is the Name of a specific curve, this way you only need to create one scriptJob. Hope this helps ....
-----------------------------------------------------------
string $sel[] = `ls -sl`;
switch ($sel[0])
{
case "browCurve":
... browCurve command code...
break;
case "lipCurve":
...lipCurve command code...
break;
case "eyeCurve":
... eyeCurve command code...
break;
}
Huitt
05-14-2008, 04:06 PM
This is exactly what I was looking for! Thanks so much.
Now, I just have to do it... I'm not yet a master at scripting, but I'm sure I can figure it out. :D
CGTalk Moderation
05-14-2008, 04:06 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.