<< back to andrewsilke.com

MEL SCRIPTS FOR MAYA
Display Marking Menu
Animation Hold
Snap Keys To Current Time (retain spacing)
Snap Keys To Current Time
Align Keys to Integer Time
Key Frame Scaler

Installing Scripts
Mel Links



Display Marking Menu Page Top

This script makes the annoying display menu into a hotkey, to easily toggle the visibility of polygons, nurbs, camera, lights, curves display etc.

Be careful when mapping this to modifier combinations such as shift ctrl or alt keys, you have to make a small change in the script or it won't work, open the .mel file in a text editor and read the instructions.

Map uiShowMMenu; to hotkey (press).
Map zzShowMMenuKillUI; to a hotkey (release)

I couldn't screen-grab the Marking menu so here's a picture of the menu it replaces...



Make Animation Hold by David Peers Page Top

This script speeds up the modification of animation holds where two keys are needed to hold static poses. I thought of this script when I was repeating the same task over and over while blocking my animation. Thanks to David Peers for writing this one!

Here's what my basic blocking curves look like. The flat curves are when a character holds still, otherwise called a held pose or bookend keys.

The problem I had was that 2 keys must set for just one pose. This hotkey is solves that problem. It's smart, just change one key frame (see MODIFIED POSE below) then run the hotkey. It will automatically detect the current or last keyframe from current time and create a held pose. eg.

It also works on selected curves...

The script will only affect the last or current keyframe from your position in the time line if you don't have any curves selected.

But you don't have to change any keys at all!! Simply change the position/rotation of your objects and hit the hotkey. The new held pose will be created automatically. (Autokey must be turned off)

Map dpMakeHold; to a shelf button or hotkey after installing the script.


Snap Keyframe to Current Time (Retain Spacing) by David Peers Page Top

This script when mapped to a hotkey snaps the selected "first key frame" to current time. It retains the spacing of keys (see the animated gif below). eg. Play your animation and hit stop when you want an action or keyframe to take place - select the key/s then snap!

Map dpMoveSelectedKeys; to a shelf button or hotkey after installing the script.


Snap Keyframe to Current Time Page Top

This script is the same as the above however it will try to snap all keys to current time without retaining spacing. Great for ordering curves. This script is actually just one line of code. Create a user hotkey or shelf button with:

int $currentTime = `currentTime -q`;


Align keyframes to Integer Time by Howard Fuller Page Top

Do you ever find your keys on decimal frame numbers eg. frame 5.678. This script aligns the keys to the closest integer value ie. frame 6. Thanks Howie! Map to a shelf button or hotkey

Map source hf_alignkeys.mel; to a shelf button or hotkey after installing the script.


Key Frame Scaler by David Peers Page Top

Ok this is a very handy script, it's more useful than it sounds. It scales keys from the center of each curve. For example you have a character shaking his head, but your euler curves are spread out. This script will scale from the center of each curve which is calculated from the center of selected keys on each curve. There's a handy interface that pops up, click on the buttons to scale incrementally. This baby comes in handy more than you'd expect.

Map keyScalerButtons; to a shelf button or hotkey after installing the script.

Or hit the invert button...


Installing Scripts Page Top

All .mel scripts should be copied into a directory in your scripts path
eg. documents path \maya\5.0\scripts
it might be something like this (depending on your operating system)
C:\Documents and Settings\User\My Documents\maya\5.0\scripts

You can open .mel files in text browsers, most should include instructions in the .mel file.

Most of these scripts can be mapped to hotkeys or shelf icons.

Shelf Icons
To create a shelf icon
1. Open the script editor (window>general editors>script editor ...)
2. Type the command in the text box
3. Highlight the text
4. Middle click drag the text into the shelf

Hotkeys
To create a new user hotkey open the hotkey editor (window>settings/preferences>hotkeys...)
Then create a new user hotkey. (see Image)

Finally assign the hotkey to the key of your choice.


Mel Links Page Top

Highend 3d
http://www.highend3d.com
My good friend Hamish McKenzie also has some great animation .mel scripts
http://mel.macaronikazoo.com/

 


<< back to andrewsilke.com