Maya assign hotkey to shelf button
Om.tBool(refCode, allow_save)Ĭb_id = om.MSceneMessage.addCheckCallback(om.MSceneMessage. You should set the value of refCode using (refCode, value). If refCode is False when the function exits the operation is cancelled, if it is True the operation completes as normal. In both cases the callback function is passed a refCode and clientData argument. The difference between those two is that addCheckFileCallback is passed an MFileObject which “is the MFileObject that will be acted on by the current file IO operation, any modifications to it will be passed back to Maya and change the file being acted on.”
MAYA ASSIGN HOTKEY TO SHELF BUTTON FULL
See the API page for MSceneMessage for a full list of Messages that work with the different add*Callback methods ( ) OpenMaya.MSceneMessage has two ways to add callbacks that can also cancel an operation:ĪddCheckCallback works with a subset of the full list of Messages, and addCheckFileCallback works with a subset of addCheckCallback’s usable Messages. I recently used this last approach to run a maya ascii file scrubber each time the file is saved. However, default RunTimeCommands cannot be edited after they are created… so… what you can do is copy Maya’s “l” file into your local folder and edit the “SaveScene” and “SaveSceneAs” runtime commands to perform your operations before and after and won’t have to worry up about updating the File Menu, Status Icon, Hotkeys, custom Shelf Buttons, etc. The problem is, my mouse has no MMB (i have logitech marble).
![maya assign hotkey to shelf button maya assign hotkey to shelf button](https://s3.amazonaws.com/east.toolfarm.com/boxcover_image/maya-2023-box.png)
MAYA ASSIGN HOTKEY TO SHELF BUTTON UPDATE
If you could somehow edit that RunTimeCommand, you can alter Maya’s Save Scene function AND also update all Hotkeys, Shelf Buttons, Menus and Icons in one stroke. Hi all I want to know whether or not i can change the way i pan Right now i have to use middle mouse button. Maya has a default RunTimeCommand called “SaveScene”.
![maya assign hotkey to shelf button maya assign hotkey to shelf button](https://cdn.80.lv/api/upload/content/a7/images/6089601e1de9e/widen_1840x0.jpg)
RunTimeCommands are what you see when you go into the HotKey Editor and assign hotkeys to functions. It’s basically a layer that sits between Maya’s UI and the code it runs.
![maya assign hotkey to shelf button maya assign hotkey to shelf button](https://rmanwiki.pixar.com/download/attachments/56495794/rfm_dynamicRulesAssignRing.png)
Lastly, there is a concept in Maya of a “RunTimeCommand” - you can think of this as an alias to some code. Thirdly, you can copy the Save File MEL script from Autodesk’s folder and put in your local folder and edit that file, but I would discourage that approach. I don’t recall when Maya runs the script when a file is Saved. You can hotkey this to CTRL-S, however the File Menu option won’t call this, and the Status Bar icons won’t use it either.Īnother way is to use Script Jobs, although you don’t have control over whether the script runs before or after the save operation. First, you can create your own function… def mySaveScene():