Menus
-
-
Loads the contents of a text file into the .
-
-
Executes the contents of a text file.
MEL does not allow you to forward reference locally scoped procedures. Locally scoped procedure definitions must appear before
they are called. For example, in a file called noForwardRef.mel, define the local procedures before they are referenced.
proc myLocalProc() { print "In myLocalProc()\n" ; } proc anotherLocalProc() { print "In anotherLocalProc()\n" ; myLocalProc; } global proc noForwardRef() { print "Calling anotherLocalProc()\n" ; anotherLocalProc; }
If you change a script after sourcing it, the change is not automatically picked up by Maya. You need to re-run the script
with .
-
-
Saves the selected text to a text file.
-
-
Adds a button to the current shelf which executes the selected text.
The edit menu includes standard editing commands and their associated hotkeys: , , , , , and , as well as the following commands:
-
-
Goes to the specified line number.
-
-
Opens a search dialog where you can search for a string and replace it with a different string. You can choose the search
direction and choose whether your search is case-sensitive.
-
-
You can indent or clear the indent of selected text.
-
-
Clears the top pane of the .
-
-
Clears the bottom pane of the .
-
-
Clears both the top and bottom panes of the .
-
-
Shows batch rendering messages in the .
-
-
When this item is on, all MEL commands executed by Maya appear in the top pane of the Script editor.
For example, if you select Create > Polygon Primitives > , the corresponding MEL command (polySphere) that Maya executes is printed in the top pane.
-
-
Shows line numbers in errors.
-
-
Opens another window which lists errors and their line numbers in external script files. This is very useful for debugging
scripts in external files.
-
-
When turned on, the Script editor does not show the result of commands. Result messages start with // Result:.
-
-
When turned on, the does not show informational messages. Informational messages are of many different types and do not have a set prefix (except
for //).
-
-
When turned on, the does not show warning messages. Warning messages start with // Warning:.
-
-
When turned on, the does not show error messages. Error messages start with // Error:.
Note
Suppressing messages does not suppress messages from appearing in the .
- window
-
When turned on, the Script editor suppresses the stack window. If stack trace is enabled, results are returned to the output
window instead of a separate stack window.
The Script editor menu items can also be controlled through the scriptEditorInfo command (-sr/suppressResults, -si/suppressInfo, -sw/suppressWarnings, -se/suppressErrors, -ssw/suppressStackWindow).
The following commands allow you to create, delete, and rename new tabs in the input area of the Script editor.
-
-
Creates a new tab. You must choose whether the tab is for MEL or Python.
-
-
-
-
You can step through the tabs using the Previous and Next commands.
-
-
-
-
Shows line numbers in the .
-
-
Select this option so that when you click Tab to indent, a tab will be created rather than individual spaces.
-
-
Auto-completes command names as you type them. If is on, command names appear automatically as you type. If is off, you must press + to make them appear.
-
-
Auto-completes object path names as you type them. If is on, command names appear automatically as you type. If is off, you must press + to make them appear.
-
-
Displays auto completed commands and object paths as you type them.
-
-
Displays the panel. You can search for commands and the panel displays all valid flags for that command.
-
-
Runs the MEL script in the bottom pane of the . You can also press Enter on the numeric keypad.
Command highlighting
All MEL and Python commands are highlighted as you enter them into their respective tabs in the .
MEL scripts are automatically saved when Maya exits and restored in the when Maya is restarted.
In the event that Maya shuts down unexpectedly and is able to write a backup scene file, the current contents of each tab
are written to text files and saved in the same directory as the scene file. These filenames match that of the backup scene
file with the suffix .
Additional notes
When Python requests input through stdin (for example, the Python raw_input command), a dialog box appears where you can type
your input.