Template:Scripting script editor

From TOI-Pedia

You can enter commands in Maya in the Script editor. You can open the Script Editor through Window > General Editors > Script Editor. This interface is used to enter commands and scripts, but the history panel also provides feedback.

Maya scripteditor.jpg

If the Script Editor is opened, you'll see a window similar to the image above. The windows is divided into two parts: The top part is the history, the bottom part is where you can type. The history probably already contains some output. You'll notice that most actions in Maya result in output in the history panel. It shows the commands that are being executed and the results of those commands.

If make a polygon cube for example, we'll see something like this:

polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -tx 1 -ch 1;
// Result: pCube1 polyCube1 //

The first line is the command being executed. It shows the name of the command and several options, called flags for that command. You can recognize a flag by the dash (-) prefix, followed by one or more values.

The second line is the result of the commands. In this case it shows the name of the cube that has been created.


However, the functionality of the built-in Script Editor in Maya is limited. As soon as your scripts gets a little more complex, it's recommended to use a different editor. (The script editor in Maya 8.5 is improved dramatically, but still an external editor can be nice). One of the possibilities is Crimson Editor. If you save your file with the .mel extension, Crimson will understand it's a MEL-script and will 'color code' your script to improve readability, for instance: commands and variables get their own color. The extension .mel isn't in the standard list of file types when you save a file in Crimson. You need to suffix (type) .mel yourself.

You can use Copy-Paste to get your script from Crimson to the Script Editor van Maya to execute it, or you can save it in Crimson first (always a good idea) and the use File > Open Script in the Script Editor.

Personal tools
Actions
Navigation
Tools