12 Nov 2015

Tools and Scripts: Maya Undo

Tools and Scripts: Maya Undo

Author:  Stephen   Categories:  Tools and Scripts  

For help on setting up Maya Hotkeys, check out this tutorial here.


One of the first things I do when starting at a new studio is set up all of the hotkeys I use. By far the most important one to me is one that removes a few timeline hotkeys from the list of stored undo actions. Let's back up a bit though and explain what I mean by that.


Why is this even a thing?!

One of the preferences you can change in Maya is how many actions Maya will store in a list that you are able to undo. By default this is set to a maximum of 50. You can change it higher if you'd like but be forewarned that it will increase Maya's memory usage. It can be tempting to change it to 'infinite' since it seams like 50 is never enough and the last thing anyone wants to see when they are frantically pressing 'Ctrl+z' is that little pink bar of death.

Part of the problem with Maya's undo function is that it will store frame changes in the timeline as undo-able actions. This can be very problematic for people like me that use the Next/Previous Key and Next/Previous Frame hotkeys to 'flip' through our animation and look at our poses , spacing, etc. 


Some people are awesome

Many years ago I turned to Google to find a solution to this problem and came across the website of animator/rigger Morgan Loomis. I don't know Morgan personally, but if you want to take a look at his website, he's got some pretty cool tools he's made available. Anyway, one of the scripts he had was a really short code that essentially turned off your undo history state, performed the desired action, and then turned your undo history state back on. By replacing specific Maya hotkeys with his commands,  you can set it up so that Maya won't store any of your 'flipping' and save only the things you might actually want to undo (why on earth would I ever want to undo a change of frame in the timeline?). I wanted to repost these here in case anyone hasn't come across them (or something similar) but do want to say thank you to Morgan for saving me a ton of work over the years.


Get to the scripts, already.

The following are the commands I create in the 'user' category of the Hotkey Editor. I create them there instead of changing the code in Maya's default hotkeys because I like to keep all of the scripts I use in one place. I've included the hotkey I assign to it in brackets, which basically just overwrites Maya's hotkeys for the same action.

nextFrame (“Alt+.”)
undoInfo ­stateWithoutFlush off;
undoInfo ­stateWithoutFlush on;

previousFrame (“Alt+,”)
undoInfo ­stateWithoutFlush off;
undoInfo ­stateWithoutFlush on;

nextKey (“.”)
undoInfo ­stateWithoutFlush off;
currentTime ­edit `findKeyframe ­timeSlider ­which next`;
undoInfo ­stateWithoutFlush on;

previousKey (”,”)
undoInfo ­stateWithoutFlush off;
currentTime ­edit `findKeyframe ­timeSlider  ­which previous`;
undoInfo ­stateWithoutFlush on;


That's it! You are now free to make more mistakes!


Have any tools or scripts you use that you want to share? Email me and we can make it available for everyone! 

Photo Credit: {Guerrilla Futures | Jason Tester} via Compfight cc

Number of views (1981)  Comments (0)


    Please login or register to post comments.