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 5K
  • Win 4K
  • OS X 968
  • Linux 333
Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10
Windows 6 5 7 6 7 12 22 4 7 4 4 7 10 9 4 1 6 13 17 5 8 39 0 16 5 39 9 6 6 3 4 8 6 7 5 5 4 4 4 4 5 10 15 2 1 4
OS X 2 0 0 1 1 0 0 3 0 0 3 0 0 0 0 0 0 1 1 4 1 2 0 0 3 1 0 0 0 2 0 0 2 3 1 2 0 0 0 0 0 0 1 0 2 1
Linux 0 0 0 1 0 0 2 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 2 2 0 0 0 0 1 1 0 3 0 0 1 0 1 0 1 1 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”