Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
Python
Switch branches/tags
Permalink
Failed to load latest commit information.
Snippets Migrate snippets to Snippet subdir, since there are a lot; Nov 17, 2013
lib Fixes #28 - Added missing sys module import Nov 5, 2016
messages Update package control changelog message Nov 5, 2016
.gitattributes Line Ending Normalization Dec 2, 2012
.gitignore Ignore .DS_Store and Sublime project/workspace Aug 6, 2013
Comments.tmPreferences Adding file to make comments toggle work with MEL Feb 5, 2013
Context.sublime-menu Add ability to source/import file sans selection Dec 2, 2012
Default (Linux).sublime-keymap removed explicit calls to language in keymap for osx and linux Dec 2, 2012
Default (OSX).sublime-keymap removed explicit calls to language in keymap for osx and linux Dec 2, 2012
Default (Windows).sublime-keymap Add ability to source/import file sans selection Dec 2, 2012
Default.sublime-commands #26 - Feature: Maya publishes ScriptEditor output to SublimeText cons… Sep 12, 2016
LICENSE #26 - Feature: Maya publishes ScriptEditor output to SublimeText cons… Sep 12, 2016
MEL.tmLanguage Handling .mel files Jul 3, 2012
Main.sublime-menu Renamed package -> MayaSublime Jul 3, 2012
MayaSublime.py Fix a crash when Package Manager installs plugin as archive file (can… Sep 12, 2016
MayaSublime.sublime-settings #26 - Feature: Maya publishes ScriptEditor output to SublimeText cons… Sep 12, 2016
README.md <kbd> tags can make keyboard keys more readable. (#31) Feb 1, 2017
messages.json Update messages.json Jun 14, 2016

README.md

MayaSublime

A Sublime Text 2/3 plugin

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

Features

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

Installation

Easy Install

You can install this plugin directly from Sublime Package Control:

https://packagecontrol.io/packages/MayaSublime

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.

Usage

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"