PyDev is a Python IDE for Eclipse, which may be used for Python, Jython and IronPython development. This is particularly useful for Maya/Python development. This setup was tested on Windows 7 and 8.1, using Maya 2013 and 2014.
Getting Started
PyDev
To obtain PyDev in Eclipse:- Help > Install New Software
- Add...
- Inside Location, add: http://pydev.org/updates, leave Name blank.
- Once you've added the location, select it in the field "Work with:", then tick PyDev, hit next and follow the prompts to install.
Maya Plugin
To obtain the Maya plugin for PyDev/Maya integration, go here. Extract to any folder and install in Eclipse:- Help > Install New Software
- Add...
- Local... and navigate to the directory you extracted the Maya plugin to.
Eclipse Configuration
- Window > Preferences
- PyDev > Interpreters > Python Interpreter
On the right, click on “New” and navigate to the directory with mayapy.exe. e.g:
“C:\Program Files\Autodesk\Maya2013\bin\mayapy.exe” - Include all folders
- For autocomplete, go to the Predefined tab, hit "New..." and navigate to the directory with the .pypredef files. e.g:
“C:\Program Files\Autodesk\Maya2013\devkit\other\pymel\extras\completion\pypredef ”. Hit apply.
- PyDev > Interpreters > Python Interpreter
Maya Configuration
Maya needs to open a commandPort to receive the code from Eclipse. You can either manually open the port with a Shelf button, or automatically open the port by configuring the userSetup.py.import maya.cmds as cmds if cmds.commandPort(':7720', q=True) !=1: cmds.commandPort(n=':7720', eo = False, nr = True)You're done now. The basic idea with this set up is to first run the commandPort code in Maya, then highlight your PyDev code in Eclipse, and hit ctrl+enter to execute your code.