Animation MEL scripts and tricks for fancypants workflow.

Heya hens and hatters!!

I thought I might just write up a post sharing all the extra tools I use regularly to help animate and speed up workflow in Maya. These are all either MEL scripts or custom keyboard short-cuts that I absolutely rely on every time I animate. If you'd like help on how to setup custom user shortcuts or use MEL scripts I'm sure it's easy enough to find in the help file or by seeking the prophet that is google :-P. For the custom user shortcuts, I've put the command line in "inverted commas". This post is a bit more techy than usual, so if it's all a bit dull for you, just scroll down the bottom for a cute little frog picture :-P.

I love animating just in the viewport and throwing keys all around the timeline. So here's a few shortcuts I use for animating without having to get into the graph editor or do any time-snatching right clicking:

Converting a selection of key types on the timeline:

Convert to Spline: alt + ctrl + z "timeSliderSetTangent spline;"
Convert to Linear: alt + ctrl + x "timeSliderSetTangent linear;"
Convert to Stepped: alt + ctrl + c "timeSliderSetTangent step;"
Convert to Flat: alt + ctrl + v "timeSliderSetTangent flat;"

So hitting any of these will convert all the keys in a timeline selection to that respective tangent type. I use these often when blocking and it's easy to double click on the timeline (selects all active range) and then hit one of these to convert your whole animation into any tangent type in a fraction of a second. I often convert all my stepped keys to linear when I'd like to add some breakdowns, then swap back to stepped again when I've created all the breakdowns I want. When I'm first converting to spline, it's handy to force extreme keys to flat to stop them overshooting in unpredictable ways so I can get around to fine tuning in the graph editor later on. There's no fancy tech here, just getting faster control for blocking without taking my eyes off the viewport ;-).

delete keys in selection on the timeline: d "timeSliderClearKey;"
Clears whatever keys are selected in the timeline. Faster than right clicking on timeline for it.

Add 1 frame: ctrl + + (plus key) "timeSliderEditKeys addInbetween;"
Remove 1 frame: ctirl + - (minus key) "timeSliderEditKeys removeInbetween;"
Simply pushes all the keys after the current frame forward or backward by one frame. I only ever use these when I'm blocking in a straight ahead type fashion. It's quite satisfying just bumping a hold up and down by a frame per click.

Smart key MEL script.

It was originally Mike Benson who introduced me to this script, he claimed "you won't know how you ever lived without it!". He be right. When enabled, it means whichever channel you select in the channel box, it will only display that channel's keys in the timeline and will automatically show only that channel's graph in the graph editor. It's great when concentrating on one axis at a time when polishing and adding minor offsets. I find it's best to turn it off when I'm not needing it, so I've given it a quick toggle shortcut key:

Smart key toggle: ctrl + shift + S "abxSmartKey;"

Another script I'm eternally grateful for that Mike introduced me to is this little one which enables you to toggle the NURBS curves display on and off via a short-cut key. This is obviously handy for animating when your rig's controllers are made of curves and you want to swap their visibility back and forth swiftly as you test how a pose looks.

pt_toggleNurbsCurvesDisplay.mel (not sure who wrote this, wasn't me but I thought I'd host it if anyone wanted it)
Toggle Nurbs curves display: ` (that's a tilda) "pt_toggleNurbsCurvesDisplay;"

For polishing, I'm dependent on another great little script which most animators probably already know, Auto Tangent. Find it here: http://www.comet-cartoons.com/melscript.php . I love it for selecting several keys at a time and just dialing in a softness value and it generally gives a pretty satisfying result at best guessing how you want your tangents plotted across your keys. I've got a custom short-cut key for this one too:

Auto tangent: Ctrl + alt + q "autoTangent;"

One last script I can't live without is Hamish Mckenzie's ZooSetmenu script (it's part of Hamish's ZooToolbox script which you can find here http://www.macaronikazoo.com/ ). Once you've created a "Quick Selection Set", this script allows you to select that group very quickly and easily. You just have to select any object that belongs to that set, and hit a defined key and it'll select all objects in that set. Very useful for instantly selecting every controller on a character, or all the fingers, or all the facial controls in one shortcut (as long as you've created the sets first). Make sure you have "select previous/current set" under default behavior after you've installed it (found by holding down the short cut key and left clicking, then select "control window" from the marking menu). There's also some nifty tools in the control window to help manage your sets.

Select all of quick selection set: y "zooSetMenu;"
also: y (release) "zooSetMenuKillUI;"

One last little trick I use is to source a fraction of a frame to create an in-between when you've got fast motion and a key on every frame. Sometimes I wish a pose on Frame 213 was just a tiny bit closer to the one of 214 for example. In the current frame value (just right of the timeline), you can enter partial frames like 213.3, and that'll draw the frame that is %30 between frame 213 and 214. You can now middle mouse click on frame 213 and set a key with the desired controllers selected and you now have that pose on 213.

Well that's all the tools I use regularly, if anyone has any questions about them feel free to ask and I'll do my best to confuse you less :-P. Also, if anyone would like to suggest some anim tools they use often, I'd love to be introduced!

Also, here's a little sketch I put together on a Sunday Arvo a while back:

Over and inside-out.

No comments: