Toggle w, e, r via MEL-Script?

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
  05 May 2013
Lightbulb Toggle w, e, r via MEL-Script?

How can I create a MEL-Script that toggles between Move, Rotate & Scale on selected Objects? Instead of using my keaboard's w, e, s I could hotkey the script to one button, this might be a useful alternative (!?)
  05 May 2013
Turn on echo all commands in the script editor and press w, e, or r. You can see the MEL Maya is executing right there =).

setToolTo $gMove;
setToolTo $gRotate;
setToolTo $gScale;

Toggling through them is just a matter of waiting for an input (or you could just map the mel script to a hotkey).
  05 May 2013
thank you, vb2341, but thats my problem: I don`t know how to tie them together. Do I have to use scriptCtx or something? What is the "wait for user input" command? I think the mel script has somehow to check which mode (rotat, scale, move) I'm currently using, so it can switch to the next.
  05 May 2013
Dont know maybe you are new to 3D and so it seems to make sense to toggle the transform modificators, but in the long term you are better on having them on different buttons, its just much faster to operate while modeling. Also map the often used functions to single buttons (for example undo: "ctrl z" is bad, "z" is better, so you dont need to use both hands), also have buttons used in a similar context in a bunch, means something like parent, unparent, group, centerPivot, edit pivot mode, duplicate, transformation modes etc. are good spatially arranged if you reach them all with your fingers without moving your hand much.
  05 May 2013
put the script on a key than query for the manipulator type, for use in some if else statements.

if tool is x:
setTool y
elif tool is y:
setTool z

and so on.

can't write it for you know since I'm on a phone, but will make it up when I get home tonight.

though I do have to agree with the rest, the q w e r setup is far far better, than a 3 or 4 way toggle like you want.
  05 May 2013
Thumbs up Solved!

... well - useful or not useful - I like it Here is what I assigned to my hotkey:

 string $currentTool = `currentCtx`; 
   if ($currentTool == "moveSuperContext")
     setToolTo $gScale;
     else if ($currentTool == "scaleSuperContext")
     setToolTo $gRotate;
     setToolTo $gMove;
  05 May 2013
ya just saying you will be missing out on some great functionality in Maya because of this, since not only does w e and r change the tool, you can hold it and lmb for a marking menu full of all the options for said tool.

some things are a little hidden but the keys and marking menus of maya are pretty well thought out.
  05 May 2013
I agree with zaskar and CMCPasserBy. Make sure you know what you are leaving behind before you change too much. I love to customize maya, and my hotkeys are an example of that, but keep in mind, if you ever work in a team you will soon discover the advantage of having the same (or similar) setup as everybody else. If you have personally customized you hot keys completely different to standard maya, then it can make for some fun and games when your supervisor tries to show you how to do something.

  05 May 2013
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 05:48 PM.

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