Maya use spacebar to drop/finish tool

I’m using MODO a lot. There are bunch of neat modeling tools with this package. Then seems my muscle start to remember hotkeys and behavior of how I modeling.
One of the most frequent function is use space bar to drop current modeling tool. e.g. current tool is “Bevel”. Then after finishing beveling edge, use spacebar to drop the “Bevel” tool and return to “Select” tool.

But, in Maya, spacebar is to popup the hot box and switch between single view and quad view. (if you press sapcebar slowly, will only popup hot box.) Seems like same key controls 2 different functions.(hotbox and switch viewport)

what I want in Maya is:

  • use space bar to drop current modeling tool.
  • I kind never use the switch viewport function. So better to turn it off.

I cannot find any built-in script to control these other than a command called “hotBox”. But also cannot get what I want.

So I made a “if statement” to the spacebar hotkey. Both show hotBox and hide hotBox.


//show hotbox
if (`currentCtx` == "selectSuperContext" || `currentCtx` == "moveSuperContext" || `currentCtx` == "RotateSuperContext" || `currentCtx` == "scaleSuperContext")
hotBox;
else
SelectTool;

//hide hotbox
if (`currentCtx` == "selectSuperContext" || `currentCtx` == "moveSuperContext" || `currentCtx` == "RotateSuperContext" || `currentCtx` == "scaleSuperContext")
hotBox -release;
else
SelectTool;


Any better ideas?

I’m a little confused by this:

I cannot find any built-in script to control these other than a command called “hotBox”. But also cannot get what I want.
So I made a “if statement” to the spacebar hotkey. Both show hotBox and hide hotBox.

Is it working the way you want it to or not?
There’s nothing wrong with putting an if…then statement in the hotkey scripts, so if it works then go with it.

Edit:
I thought about it a little more… hotBox is an internal Maya Command. It has two flags of note: -noClickCommand and -noClickDelay. Currently -noClickCommand is set to “panePop”, which is an external MEL file that you can look at in /Program Files/Autodesk/MayaVersion/scripts/startup/panePop.mel. What you’ll want to do is replace the call to panePop (that’s what switches the views) with the call to complete your tool, or switch to select, or whatever behavior you want instead of panePop. With this approach, you shouldn’t need to do anything in the hotkey editor, but you will need to modify the hotBox command every time Maya starts, which is easy enough to do with userSetup.mel.

Try running:
hotBox -noClickCommand “SelectTool”;
In the script editor and see if that gives you the behavior you want (reset your hotkeys first). If it does, add it to userSetup.mel to have it enabled every time Maya starts.

1 Like

@ Byterunner: Thanks man. It works perfectly! :eek:
BTW, how do you know the “-noClickCommand” flag is set to “panePop”?

-aaron

Its defined in scripts\startup\HotboxMenus.mel, on one of the last lines:

hotBox -noClickCommand “panePop” -noClickDelay 0.4;