Wednesday, July 24, 2013

Using Eclipse as Maya IDE

This post is going to be a little step-by-step guide to setup Ecplipse and use it as python IDE for Maya on windows7 (BTW I'm using  Maya 2013 x64). Well, let's begin!

What we need?


Eclipse Standard - http://www.eclipse.org/downloads/


Maya Editor script - http://www.creativecrash.com/maya/downloads/applications/syntax-scripting/c/eclipse-maya-editor


Setup:


1. Unzip eclipse-standard-kepler-R-win32-x86_64.zip (I downloaded the 64bit version but you can use the 32bit version if you don't have a x64 processor).

2. Unzip org.eclipse.EclipseMayaEditorProject.zip in a temp folder (after the installing we are not gonna need it anymore)


3. Enter in eclipse folder and execute eclipse.exe. Go to Help > Install new software

4. Press Add button and then in Local select the folder where you have unzipped EclipseMayaEditorProject.


5. It will appear as Uncategorized, select it and press Next. Accept license, etc.


Maya editor buttons:

  • Send entire contents to Maya
  • Send highlighted selection to Maya
  • Button menu to open various documentation
  • Reconnect Eclipse to Maya


6. Let's install PyDev! In eclipse go to Window > Preferences


7.  Go to Install/Update > Available Software Sites.. and press Add...

8. Type PyDev on Name and paste the url http://pydev.org/updates


9. Now, go back to Help > Install new software. On "Work with" choose PyDev and choose the 2 items. Press Next.


10. Choose "Keep my installation the same..." and press Next.

11. Select and accept certificates.



12. Configure the python interpreter on Eclipse. Go to Window > Preferences. On PyDev > Interpreter - Python... press "New.." button.

13. Browse and select where mayapy.exe is.


14. Select all the paths you will need and press OK.


15. Server setup to send info from eclipse to Maya. Go to Window > Preferences > Maya Editor Preferences. The default port is 7720.


16. Create a userSetup.py (if we dont have it) and add the next lines. The next time we open Maya will receive data from the port 7720.

import sys
import maya.cmds as cmds

newPath = "D:/+ENGINES/MAYA/Maya-Scripts"
sys.path.append(newPath)

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


17. Create a new Project. New > New > Project... and select PyDev Project


18. Select the Directory project, set Grammar Version to 2.6 and select mayapy.exe as Interpreter.


17. And finally the funny part!! Let's test it. Create a new file on our project folder and write a name (ex: test.py). It's important to add the .py extension.


18. Write some code and send to Maya pressing Ctrl+Enter or the menu button.


19. The result :)


This tutorial is based/inspired on rbublitz work on CreativeCrash:
http://www.creativecrash.com/maya/tutorials/using-tools-scripts/c/using-eclipse-as-a-maya-ide

No comments:

Post a Comment