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

Maya​Sublime

by justinfx ALL

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

Details

Installs

  • Total 12K
  • Win 10K
  • Mac 2K
  • Linux 655
Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12
Windows 0 3 1 0 2 1 1 0 0 0 2 0 0 1 1 0 1 1 1 1 1 0 0 1 0 0 0 0 1 3 1 0 2 1 1 0 3 0 1 1 1 0 1 0 1 3
Mac 0 0 1 0 0 0 0 0 0 0 0 1 4 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
Linux 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 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”