Adverti horiz upsell
Using Eclipse as a Maya IDE
Using Eclipse as a Maya IDE
rbublitz, updated 2014-05-11 01:55:25 UTC 286,361 views  Rating:
(15 ratings)
Page 1 of 4

This tutorial was updated in May 2014.

 


There are many choices when it comes to deciding on an IDE.  At the time when I decided on Eclipse (back in 2005) I needed an editor that could do the following:

  • useable across multiple platforms
  • supported programming in Python, C++, mel, Java
  • had syntax highlighting and code completion
  • supported writing of plugins (I needed to connect with Maya's environment)


This tutorial will outline the steps I've taken to make Eclipse my Maya IDE.  I will address the following:

  • enabling communication to and from Maya within Eclipse
  • quickly access documentation from often used libraries
  • setting up code completion for Maya Python commands and Maya API
  • provide a mel editor with syntax highlighting


Please let me know if there are further improvements you'd like addressed.

 

 

A. Basic resources.

Eclipse:
https://www.eclipse.org/

Pydev the open source python plugin for Eclipse
https://pydev.sourceforge.net/

Eclipse Color Themes
https://eclipsecolorthemes.org/?view=plugin

Eclipse Colorer Plugin
https://colorer.sourceforge.net/eclipsecolorer/index.html 

Maya Eclipse Editor Plugin
https://www.creativecrash.com/maya/downloads/applications/syntax-scripting/c/eclipse-maya-editor

 

Eclipse Autocompletion for Maya
https://www.creativecrash.com/maya/downloads/applications/misc/c/eclipse-autocompletion-for-maya-python-api

 

Maya Eclipse mel Plugin
https://www.creativecrash.com/downloads/applications/syntax-scripting/c/eclipse-maya-mel

 

 

 

B. Maya Editor

Features:

  • Import the script being edited (add the script location to sys.path and import/reload it)
  • Send the entire contents of an editor to Maya
  • Send a highlighted selection to Maya
  • Get results back from Maya in a dedicated console view
  • Anything done within Maya's own script editor is also echoed in the console view
  • Change the port number of the socket at any time
  • Open up documentation for Maya's Python API, Python Commands, Pymel, Qt, PySide, PyQt

 mayaEclipseButtons

 

Setup Eclipse:

New - Use the Eclipse Marketplace to install the plugin
Open the Help/Marketplace and search for "Maya Eclipse Connect" and follow the instructions to install

Or:

 

    1.  Get the plugin from the link above and unzip the downloaded file in a temp directory

    2. Within Eclipse, you should be able to use the "Help/Install New Software" menu.  But I've found this to not always work.  Even though it's frowned upon, the easiest way is to manually copy the

eclipseMayaEditor_2015.0.0.201405032156.jar

to: [your Eclipse directory]/plugins/


    3. Relaunch Eclipse and once it's back, the EclipseMaya toolbar should be visible

 

Setup Maya:

In Maya, create a new python shelf button with the following code or put it in the Startup script.  This will launch a Maya command port that enables communication with Eclipse.  The port number should match the port number within the Eclipse plugin preferences.


import maya.cmds as cmds
if cmds.commandPort(':7720', q=True) !=1:
    cmds.commandPort(n=':7720', eo = False, nr = True)

 

Command hotkeys:

  • Ctrl + \            -> Import/Reload the script in the editor to Maya
  • Ctrl + Return     -> Send all editor contents to Maya
  • Ctrl + '             -> Send highlighted selection to Maya
  • Ctrl + ]            ->  Connect Eclipse to Maya

You can remap these hotkeys if you want something different.  Go into "Window/Preferences/General/Keys" and use a filter to display the Maya Editor commands.  The filter should be: *Maya


    Preferences:

    1. Port Number - By default, the port number has been set to 7720.  It can be changed at any time.  Remember to press the "Reconnect Eclipse to Maya" button.  This is handy if you have more than one instance of Maya open at once.
    2. Update Interval: This sets how often Eclipse checks to see if there's any new text in Maya.  It is in time units of seconds.
    3. The next eight text fields set the location of the various sets of documentation.  They can be entered either as web URLs or local file paths depending on where the docs are located.  There are 2 user defined options for other documentation sites (If anyone needs more, let me know and I can add more).


    mayaEclipsePrefs