Join George Maestri for an in-depth discussion in this video Exploring the MEL documentation, part of Learning MEL Scripting in Maya.
- Now as you start scripting with Maya you're going to need to access the documentation for the mail script commands. There are hundreds, maybe thousands of commands in MEL, and each command can have dozens of options. So there's no way you can remember all these, so you really do need to use the documentation. Now there are a number of ways to get into this. So if we go into our Script Editor here, one way is to just get a hint as to what commands are available.
So if we go to our input window and just type the letters "MO" for "move," we can get a hint. All you have to do is hit "Control," and tap the space bar, and you'll see every single command that starts with the letters "MO." So if we scroll down here and find "move," we can highlight that and then just hit the enter key and the command is entered. Now the command itself is one thing, but each command has many different options.
So we can find the options for the command by looking at the documentation for that specific command. So all we have to do is just highlight the command, right click over it, we can go to Command Documentation. When we release that, it brings up a browser window with the documentation for that command. In this case, the Move Command. So you can see that we've got all sorts of different options for this. So we've got absolute and relative, which is what we've used.
We also have options for reflection and a number of others. Now, if you scroll through these, you may find some options that will be very helpful to your script. And this has complete documentation for that script. Now if you want a more generic documentation, you can go back to the Script Editor, and under "Help," you can select "MEL Command Reference." And again, that will bring up a web browser with all the commands and the documentation.
So, if you wanted to look for, say, the Move Command, you could actually scroll through this and find the documentation that you want. But we can also have other types of moves such as a pixelMove, and so on. So you can scroll through commands to find one that works for you. Now in addition to this, you can also search by category, so General types of commands, Modeling, Animation, Rendering, Effects, and so on. So this is a way to kind of narrow down your search for whatever type of command you were looking for.
So get familiar with Maya's MEL documentation because as you start digging deeper into script writing you're going to need to use this reference.
- Using the command line and the Script Editor
- Grabbing Script Editor output
- Creating, loading, and saving buttons
- Working with variables and arrays
- Using conditionals
- Performing calculations with the math, trig, and time functions
- Creating and testing a user interface