ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Maya​Sublime

by justinfx ST2/ST3

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

Details

Installs

  • Total 6K
  • Win 5K
  • OS X 1K
  • Linux 376
Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 1 12 2 7 5 0 1 3 2 6 9 6 4 3 6 7 21 39 30 1 16 25 26 20 39 11 7 9 11 6 7 12 10 5 5 5 10 10 8 5 7 5 8 8 3 12
OS X 1 1 0 1 0 1 1 1 1 0 1 1 0 2 2 0 0 0 0 1 0 1 1 0 1 0 1 0 2 0 2 1 0 0 0 1 2 0 1 2 0 0 1 1 2 1
Linux 0 0 1 1 3 0 0 0 3 0 1 0 0 0 1 0 2 2 0 1 0 1 2 0 1 1 1 0 1 1 0 3 0 0 0 0 0 0 1 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

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”