Click below to view the Learning Maya Tutorial Movies.
Support files including tutorial scene files and source images.
Several MEL Scripts for you to review and test in Maya.
Instructor-lead courses offer you hands-on experience with Maya.
Books, videos and CD-ROMs offer a unique selection of self study tools.
Free online resource including how-tos, MEL scripts, scene files, and shaders.
Free Clips and Textures for you to use from various Artbeats titles.
How To Use the CD MEL Scripts

The purpose of this lesson is to familiarize a new user with installing and executing a typical MEL script that can be found on this CD. There are several ways in which Maya is able to process a script. This lesson will go through 2 options: Placing Scripts into Script Directory and Using the Script Editor.

NOTE: MEL scripts provided on this CD have been tested to ensure they will function when the steps below are followed. Scripts from outside sources may not work with these instructions.

What is a MEL script?

A MEL script is a file that contains Maya Embedded Language commands, procedures, or both. Typically, you use a MEL script to execute a sequence of commands.

You can write a MEL script using a text editor then save the MEL script in a file on disk. MEL scripts use the file extension .mel. You can use scripts over and over for different scenes and in different work sessions. When you execute a MEL script, it does not become part of the scene; you must execute the script each time you want to repeat the action.

Read the contents of the script

Before installing or using any script, it is very important to read the comments and description within the script. This can be accomplished with any text editor.

All scripts on the CD will contain information in the header about the purpose and usage of the script. The usage of the script will typically state whether any variables are required to execute it. Also, when reviewing the header, keep note as to whether the script is a reference to another script. In this case, the referenced script must reside in the script directory as outlined in option 1 below.

Option 1: Placing Scripts into Script Directory
By default, MEL scripts are to be located in the directory ~/maya/scripts. If you have placed a script into the scripts directory, you simply need to type the procedure as described in the script header into the command line within Maya.

Since Maya will not find a definition for the command, it will search through the script paths for a MEL script with the same basename as the command. When it finds the file, it will declare all the global MEL procedures within that file. Furthermore, any global procedures with the same basename as the command are executed.

Option 2: Using the Script Editor
To create, change, or use MEL scripts you may want to use the Script Editor. The Script Editor can be opened by selecting Window > General Editors > Script Editor or clicking the Script Editor icon at the bottom right of the Maya window.

Opening a script
You can open a script by selecting File > Open Script from the Script Editor. This will display the Open Script window. After you choose a script and click OK, Maya will open the selected script in the command input section (bottom portion) of the Script Editor without executing it. To execute the script, use the "Enter" key on the numeric keyboard or select Edit > Execute. Note that copying and pasting into the Script Editor is also an option.

Sourcing a script
You can open a script by selecting File > Source Script from the Script Editor. Sourcing a MEL script file executes all of the MEL commands and declares all global procedures that are contained within the script file. This is similar to opening the script except it will not be visible in the Script Editor.

Remember that opening and sourcing will only put the script into memory and still requires the procedure as described in the script header into the command line or script editor within Maya.

Conclusion
You now have a quick start outline to begin using the scripts on this site. Over time you will become accustomed to the language and function of MEL so you can create your own scripts.

Your use of this file confirms your agreement to the
Terms and Conditions set out in the Terms and Conditions page.