Integration with Mel

return to main index


Cutter incorporates some specialized features to help Mel scripters. Cutter can,

  • hilite text using syntax coloration,
  • show a popup menu of flags,
  • open a web doc for a Mel command,
  • search the Mel docs,
  • communicate directly with Maya (commandPort),
  • commandPort and Vista.

Syntax Coloration

The syntax coloration that Cutter applies to Mel scripts can be customized via the Preferences Tool - figures 1 and 2.

Figure 1
General document coloration preferences

Figure 2
Mel syntax coloration preferences

Show a Popup Menu of Flags

The first time a Mel script is opened or saved, Cutter reads the documentation for the built-in Mel commands - figure 3. It does so not be reading the actual docs that come with Maya but by referencing a "digest" of the commands contained in the Cutter_Help directory.

Figure 3

Using its database of Mel commands, Cutter can show a popup menu of flags and their descriptions when the user right clicks, or Control + clicks, on a command. Figure 4, for example shows the flags for the sphere command. For convenience the flags are sorted into alphabetical order. If the user releases the mouse on the long name of a flag the full name will be appended to the command. Likewise, for the short form of the flag.

Figure 4

The same keyboard shortcuts (or right mouse click) can also be used for command completion. For example, figure 5 shows the result of right mouse clicking on the word "add". Running the cursor over the menu items will cause Cutter to display information about each command.

Figure 5

Open a Web Doc for a Mel Command

Control + double clicking (Apple + double clicking on OSX) on a Mel command will trigger Cutter to open the relevant web doc for the command. The doc will be shown in Cutter's internal web browser - figure 6.

Figure 6

If the shift key is also held down, Cutter will open the doc in the users preferred browser. For these facilities to operate correcty the relevent preferences must be set - figures 7 and 8.

Figure 7
Specifying the location of the Mel docs
"Commands" directory

Figure 8
Specifying the preferred browser

Searching the Web Docs

A HTML Search Tool is available from the main menu bar - figure 9.

Figure 9

Before performing a search ensure the "target" of the search has been set to Mel - figure 10. Then choose the Search tab (figure 11) to perform the search. Searching is very fast because Cutter refers to its own documentation "digest" contained in the Cutter_Help directory. Double clicking on an entry in the Search panel will open the web doc in Cutter's internal browser.

Figure 10
Specifying the search target

Figure 11
Performing the search

Communicating Directly with Maya

A Mel script edited in Cutter can be executed directly within Maya via a command port. To take a advantage of this facility the user must first open a command port using the Mel command,
    commandPort -eo -n ":2222";
either in the Script Window or in the Mel input text field - figure 12.

Figure 12

Next the window in which the Mel script is being edited must be set up to communicate via the chosen command port - figure 13. Click on the network button in the upper right-hand corner of the text window. Select the same port number used for Maya's command port and click the "Connect" button.

Figure 13

Maya will show a communication link has been successfully established by displaying the message shown in figure 13.

Figure 13

Incidently, any port number can be used as long as it bigger than 1024. By default, Cutter uses port number 2222.

An entire script, or a selection port of the script, can be executed either by clicking on the "Send MEL" button or by using the keyboard shortcut Alt + e, or Control + e or Apple + e.

CommandPort & Vista

    commandPort -eo -n ":2222";
to open a port in Maya is fine with Linux, Mac OSX and WindowsXP. However, on Vista the following error will be generated when Cutter attempts to send a script to Maya, Connection refused

The "Connection" issue is not related to Java or Cutter but is caused by Vista. Information about Vista, Maya and ports can be found at,

The solution to the problem is to use the commandPort command twice ie.

    commandPort -n ":localhost:2222";
    commandPort -n ":2222";

Very many thanks to Stephen Weber of "Ex'Pression College for Digital Art" for tracking down the solution to this issue.

© 2002- Malcolm Kesson. All rights reserved.