From the Expression Editor, you can start an external text editor to create and edit an expression. Text editors have features useful for editing big expressions.
When you start the text editor for an expression, you can edit only that expression with that instance of the text editor. However, you can start the text editor once for each of several expressions if you want to examine or edit several expressions at the same time.
Once you start a text editor for an expression, the Expression Editor’s text field dims to indicate you can’t work there while the text editor runs. You can, though, work in the expression text field for another expression.
There is no file on disk you can edit independently of the Expression Editor. When you use the text editor through the Expression Editor, you’re working with a temporary file that’s linked to the expression stored in the scene. You can, however, copy text from an independent text file into the temporary file.
If you save an expression without specifying a filename, Maya reads the saved expression and stores it with the scene. You’ll see it dimmed in the expression text field while you’re working with the text editor.
When you close the text editor, the expression text field entry no longer is dim. The text expression field becomes active after you close the text editor.
If you quit the text editor without saving the expression, Maya does nothing. Because the expression hasn’t changed, Maya’s copy of the expression doesn’t need to change either.
Edit expressions by opening an editor such as TextEdit. Cut and paste your text into the Expressions Editor.
You can edit expressions with the text editor you’ve associated with text documents. For example, if you’ve associated Notepad with .TXT text documents, Maya launches Notepad when you select Text Editor from the Editor menu in the Expressions Editor. To use a different editor, associate the editor of your choice with .TXT files. See Windows documentation for details.
By default, in Maya Linux you can start one of these editors from the Editor menu in the Expressions Editor:
To run a different editor, see the section below, "Use an editor not listed in the Editor menu (Linux)".
The editor is displayed.
The editor’s title bar shows a filename that’s temporarily created while you work on the expression. When you write or save the file, its contents are copied to the Maya scene containing the expression.
The expression text field is inactive while the text editor is open. You can optionally close the Expression Editor window.
If you single-click the name of an object, attribute, or expression, the text editor doesn’t appear. You can single-click to browse the contents in the expression text field without opening a text editor.
If you double-click an attribute that’s already been assigned a value in an expression, the expression that controls that attribute appears in the text editor. For non-particle expressions, you can assign to any attribute in the scene, not just to the double-clicked attribute. In fact, you don’t even need to work with the double-clicked attribute at all.
If you double-click an attribute that has not yet been assigned a value, the text editor appears with no contents. If you double-click that attribute again, a new instance of the editor appears. After you assign a value to an attribute in an expression, you can start the editor only once for the attribute.
Avoid using an alias to customize your editor’s operation settings. Follow the steps below in "Change an editor’s operation settings (Linux)".
If your workstation has a text editor that’s not listed in the Editor menu, you can use it after doing a few preliminary UNIX system administration tasks.
See "Change an editor’s operation settings (Linux)" below for examples.
You can select any valid options for the editor, but you must specify that the editor runs in the foreground (if this option is relevant to the editor).
If the editor normally appears in the shell where you launched it, you must make the WINEDITOR setting display the editor in a shell.
The editor appears.
Maya launches the editors listed in the Editor menu with default operation settings. You can change the operation settings with a few preliminary system administration tasks.
You can select any valid options for the editor, but you must specify that the editor runs in the foreground (if this option is relevant to the editor). For example, jot requires the option -f, vim requires -g -f, and xemacs requires the option -nw.
An example of setting WINEDITOR for vi follows:
setenv WINEDITOR "xwsh -name mayaEditor -e vi"
An example for vim follows:
setenv WINEDITOR "xwsh -geometry 80x57+350+130 -bg 97 -e vim"
The editor appears.
You can make an external text editor start by default each time you start a text editor.
The Preferences window appears.
To select an editor specified with the WINEDITOR environment variable, select Other.
The editor appears. The next time you start the Expression Editor, the editor’s name appears in the Editor pull-down menu by default.
If you’ve chosen different text editors in the Preferences window and the Editor menu, the one chosen in Preferences appears.
The text editor appears when you click the New Expression button.