Send selected Python and MEL code snippets from SublimeText to Maya via commandPort

License: MIT

Language: Python


A Sublime Text 2/3 plugin

Send selected MEL/Python code snippets or whole files to Maya via commandPort


  • Optional streaming of all Maya Script Editor output back to Sublime console
  • Maya undo support
  • Includes MEL Syntax Highlighting for Sublime


Easy Install

You can install this plugin directly from Sublime Package Control:


Manual install

  1. clone this repo into the SublimeText2/3 -> Preference -> Browse Packages directory:
    git clone git://github.com/justinfx/MayaSublime.git

  2. Edit the MayaSublime.sublime-settings file, setting the port to match the commandPorts you have configured in Maya

  3. Optionally edit the keymap file to change the default hotkey from ctrl+return to something else.

Note - Ideally you would make your custom changes to the user settings and not the default settings, so that they do not get overwritten when the plugin is updated.


To send a snippet, simply select some code in a MEL or python script, and hit Ctrl+Return, or right click and choose "Send To Maya". A socket connection will be made to a running Maya instance on the configured port matching MEL or python, and the code will be run in Maya's environment.

As an example, if you want to open a commandPort on port 7002 for python (the default port in the config), you can do the following:

# if it was already open under another configuration
cmds.commandPort(name=":7002", close=True)

# now open a new port
cmds.commandPort(name=":7002", sourceType="python")

# or open some random MEL port (make sure you change it to this port in your config file)
cmds.commandPort(name=":10000", sourceType="mel")

Receiving results from Maya

By default, results from commands sent to Maya will not returned to Sublime, so output would be viewed from Maya. The ability to stream all output from the Maya Script Editor can be enabled in two different ways.

Edit the MayaSublime.sublime-settings file to make feature enabled by default:

	"receive_maya_output": true

Or, use the Command Palette to toggle the feature on or off: "Maya: Enable ScriptEditor Output"

Project Statistics

Sourcerank 7
Repository Size 55.7 KB
Stars 100
Forks 39
Watchers 33
Open issues 3
Dependencies 0
Contributors 8
Tags 8
Last updated
Last pushed

Top Contributors See all

Justin Israel Nate Allison William Ledoux Mahmoodreza Aarabi Fredrik Averpil Kenny Singer Corban Mailloux Alan Fregtman

Packages Referencing this Repo

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
Latest release 3.0.4 - Updated - 100 stars

Recent Tags See all

3.0.4 July 02, 2017
3.0.2 November 05, 2016
3.0.1 September 12, 2016
3.0.0 September 12, 2016
2.3.1 June 15, 2016
2.3.0 June 14, 2016
1.1.0 November 09, 2013
1.0.0 January 29, 2013

Interesting Forks See all

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
JavaScript - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2017-10-26 22:14:06 UTC

Login to resync this repository