Mastering MELScripting

MEL scripting refers to the Maya embedded language that is used to create different objects. The different variables in the language can be used to treat general conditions, as the signifiers will represent different decimals, words and numbers. It is possible to create programs to build objects of specific heights and other types of situations. Loops are quite important, as they are used to repeat functions any number of times. This is something that computers are particularly good at, as it is a repetitive task.


MEL is a type of language in itself, as there are different scripts to use to create and manipulate different functions. If you have any experience with C++ or C scripting languages, then MEL will be very easy as the programming language is very similar.


The best place to start when using scripts is within the script editor. This button is found below the animation button. On the bottom pane of the window will be where the code is entered, and then the top box is the executed code. Write your own code in the window or paste previously used code. In order for the code to run, the execute button must be pressed.

Types of Script

The best way to go about create MEL scripts is to identify the goal of the script. This is the best way to learn how to write a script. To know what script to use is to build the object first manually and then see the script. So, create a square and then select it. It will be necessary to rename the new script and then to name the parts that are not to be used. Certain scripts are quite useful, particularly when working with different files, environmental variables and plug ins. There are many plug ins that contain script for different functions.


In order to create loops, 4 different lines will need to be used. The material will be defined with a new name in the first line. The second line will contain script for things that will not be named, and then the 3rd lines will generate a list of the selected material (and then will exclude the material that was not named in the 2nd line). Then, on the 4th line, the loop occurs. Every time the loop is completed, the variable material will become the next in the list. To find what words and symbols are needed for each command, the guide to using Maya will be needed. Try out the different commands to uncover what each command will achieve.

Advantages of MEL

While all the tasks that can be done with MEL can be achieved with the GUI, there some advantages to using MEL. MEL is preferred in some circumstances at it can be very fast when doing repetitive tasks or complicated rendering. It is quite easy to search for a script, as MAYA is used frequently. It is not necessary to completely reinvent the wheel. Take an existing script and then change it until the desired outcome occurs.