Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
- Total 7K
- Win 5K
- OS X 1K
- Linux 391
|Dec 15||Dec 14||Dec 13||Dec 12||Dec 11||Dec 10||Dec 9||Dec 8||Dec 7||Dec 6||Dec 5||Dec 4||Dec 3||Dec 2||Dec 1||Nov 30||Nov 29||Nov 28||Nov 27||Nov 26||Nov 25||Nov 24||Nov 23||Nov 22||Nov 21||Nov 20||Nov 19||Nov 18||Nov 17||Nov 16||Nov 15||Nov 14||Nov 13||Nov 12||Nov 11||Nov 10||Nov 9||Nov 8||Nov 7||Nov 6||Nov 5||Nov 4||Nov 3||Nov 2||Nov 1||Oct 31|
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
You can install this plugin directly from Sublime Package Control:
clone this repo into the
SublimeText2/3 -> Preference -> Browse Packagesdirectory:
git clone git://github.com/justinfx/MayaSublime.git
MayaSublime.sublime-settingsfile, setting the port to match the commandPorts you have configured in Maya
Optionally edit the keymap file to change the default hotkey from
ctrl+returnto 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.
MayaSublime.sublime-settings file to make feature enabled by default:
Or, use the Command Palette to toggle the feature on or off: “Maya: Enable ScriptEditor Output”