PDA

View Full Version : MEL SCRIPT help * : open / close window using same KEY to execute .


kyo
11-01-2002, 01:02 PM
hello . i am a newbie to mel scripting . i'm looking for some help on creating a mel script that does this :

i want to bind a keyboard shortcut to launch up a certain window ( ie. the scriptEditor) . AND i want to make so that once you push the same key shortcut it KILLs the script editor . ( yes i know you can use alt f4 ) but geez . i dont like to travel that far . plus it's just much more of a challenge making a MEL SCRIPT that does this .

well . summary :

same shortcut to LAUNCH and KILL any one window ( ie . when i push ALT + S , the script editor will come up . and when i execute ALT + S again . the script editor goes away .

is this possible ? thank you . : )

//. kyo

-wT-
11-01-2002, 03:06 PM
Ok I'm not going to be much help I think, but I can give you a start...

If you look at most MEL scripts which create a somesort of a GUI for itself, there's a procedure which actually creates the GUI. Check out the MEL help for commands concerning this.

Well, where there is code for creating GUI's, there's most propably code for checking if there's already that particular piece of GUI made and open.
Again, check the MEL helps for commands and technigues about those.

Then use the "Echo all commands" (Or something, damn I never remember the names of all those options, buttons and such) in the script editor to make Maya print out much more info.
Now with this feature, try tracking down the commands to create the GUI you want.

Now you should have somesort of idea how to create, delete and check if UI's excist.
With some Sherlock'ing you should be able to combine this information into a working script which first checks if the thing you wnat to do isn't already done, and if not, makes it.

Now just make a button of it.



... or, wait for someone more experienced to reply ;)

CGTalk Moderation
01-13-2006, 08:01 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.