Views:153,766 |
||
Updated:Mar 30, 2013 |
Readership Level:Advanced |
|
Tags: |
||
Maya Versions:8.x, 2008, 2009, 2010, 2011, 2012, 2013 |
Platforms:linux, mac, windows |
|
Owner: |
Language:English |
|
This is an updated tutorial - December 2011.
I began using jEdit in 2001 until 2005 and it served me well during that time writing mel, C++ plugins and python for Maya. jEdit became my Maya IDE. But I then discovered Eclipse - and it outshines jEdit.
This tutorial will outline the steps I've taken to make Eclipse my Maya IDE. The Maya Editor plugin enables communication directly with Maya for both Python and mel. It also accesses various sets of documentation. Python programming for Maya has been enhanced by adding autocompletion for the Maya API and Pymel. If there are more features you think should be added, please contact me and I'll see what I can do.
Eclipse:
Pydev the open source python plugin for Eclipse
http://www.creativecrash.com/maya/downloads/applications/syntax-scripting/c/eclipse-maya-editor
This is a plugin for Eclipse that turns it into a Maya IDE. As it is Python-centric, it also requires the Pydev plugin.
Features include:
Send the entire contents of an editor to Maya
Send a highlighted selection to Maya
Get results back from Maya in it's own 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
Setup:
1. Unzip the dowloaded file in a temp directory
2. In Eclipse, go to the Help/Install New Software page. Click on "Add" and then "Local" and navigate to the temp directory where the org.eclipse.eclipseMayaEditorProject is
3. In the "Name" section, make sure "Uncategorized" is selected and then click "Next"
4. Allow Eclipse to relaunch and once it's back, the EclipseMaya toolbar should be visible
5. In Maya, create a new shelf button with the following code or put it in the Startup script
import maya.cmds as cmds
if cmds.commandPort(':7720', q=True) !=1:
cmds.commandPort(n=':7720', eo = False, nr = True)
Command hotkeys:
Ctrl+Return -> Send editor contents to Maya
Ctrl+' -> Send highlighted selection to Maya
Ctrl+] -> Reconnect Eclipse to Maya
Preferences:
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.
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.
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).
Comments
thanks and nice to hear that someone else in world likes eclipse ;). definitely helpful. it will be more helpful if you write seecond part of this and explains
1- executing mel/python commands from eclipse and seeing results in maya (using command port or mapy )
2- also setup wxwidgets /frame working in maya from eclipse.
thanks again
yea thanks for your effort and good luck in finding a way for the plugin.
till you get it up and run i\'ll stick to your jEdit version
i also wrote my own modified macro to work whith mayaExpressions and Particles Attributes thanks a lot!
as far as commenting is not enabled in your jEedit post
i\'d like to place a question here conserning the syntax highliting for Flags
i\'d like it to remain Digits in their standard format if they follow a - sign
is that even possible i couldn\'t find any Mode conditions supporting that
I was hoping that someone would add a stable MEL IDE to Eclipse! The tutorial is an added bonus, both the tutorial and plugin work great!
Many thanks!
thanks for your efforts and I hoped it worked with me like the others,
I followed all the steps and only few keywords worked like:
import pymel
pymel.listNamespaces(root, recursive, internal)
pymel.listReferences(type)
pymel.loadReference(file, refNode)
while
pymel.b > is not autocompleting to pymel.bindSkin()
I\'m using :
eclipse-SDK-3.4.1-win32.zip
com.python.pydev.extensions-1_4_2.zip
org.python.pydev.feature-1_4_2.zip
pymel.zip (0.7.9)
jre-6u11-windows-i586-p-s.exe
python 2.5.1
windows vista sp1
wish to found the issue that causing the problem.
I can\'t get this working on osX 10.5.6. Anyone else get this working on the Mac?
thanks
Hi! Thanks for your effort! I\'m using eclipse 3.4.1.The only way of installing pydev plugin was via help->software updates...At first i didn\'t know what are you talking about pymel, and the autocompletion dindn\'t work...You need to specify that the autocompletion works only if in your project folder have a pydev module (with the extension .py), and the mel command that you are sending to maya are translated into pyton commands.So you have to specify at least that\'s an IDE for pyton...(it translates your MEL commands to pyton).I would like to know if there is some way to send MEL coomands to maya without translation to pyton.I\'m an user that get used to MEL syntax since is so close to C/C++,and i am too busy or too lazy to begin with pyton (I know that a lot of people is saying that is faster bla bla bla..), i just want to do my work with MEL.
Best regards, and thank you!
Hi alienpioneer,
you pointed that: \"You need to specify that the autocompletion works only if in your project folder have a pydev module (with the extension .py)\"
I created a module.py in project folder and still the pymel autocompletion not fully working as it should, also I found that adding pymel.io to the Forced Builtins will decrease the autocompleteing functions.
if you are really interested in Mel only, Maxya IDE is a good choice for you, but for me I use both python and mel, so I\'m still searching for a stable solution that can integrate pymel and mayaAPI.
I\'m seeing good future in eclipse pydev and python pymel and wish if the author makes his solution work perfect by showing the hidden steps.
Thanks.
hi,
i got it working so far, but sending code to maya/ reconnecting causes permanent high cpu utilization of eclipse.exe. any ideas?
EDIT: it seems i have to do a reconnect to a closed commandport first, then manually open the commandport in maya.
Great tutorial. I\'ve gotten it to work (except for autocompletion on the pymel/maya api commands that are dynamically generated).
I\'m wondering if you have the stub maya API for 2008? I could create my own based on your 2009 model, but if you have the generation script and could point it at the 2008 docs, that would be great. (For now I\'m just using the 2009 docs for my 2008 install.)
I believe the problem husni3h is having (which i think is a fundamental idiosyncracy with the way pymel is generating/importing the maya.cmds module) where autocompletion works for:
> pymel.listNamespaces
but not for
> pymel.bindSkin
has to do with the way pymel is importing things.
The pymel.listNamespaces is imported through the following steps:
in the file:
pymel/__init__.py
there is the statement:
from core import *
and in the file:
pymel/core/__init__.py
there is the statement:
from system import *
and in the file
pymel/core/system.py
on line: 239, is the definition of listNamespaces:
def listNamespaces():
On the other hand, pymel.bindSkin is imported through an indirect, dynamic import that pulls from a list of commands. I\'m not exactly sure the complete mechanism, but I believe it doesn\'t autocomplete because there is no explicit python definition of the command from which to pull the autocompletion information. Instead the command is generated dynamically from a list of commands and is appended to the module by a factory. You would have to generate a documentation stub (much like Ron does for the maya api) for all the pymel commands that aren\'t explicitly defined in the .py files.
Hopefully that helps (even though it\'s months after your question.)
Doesn\'t seem to send anything from eclipse to maya..
Doesn't seem to work for me either - I'm running the Eclipse Platform 3.5.1 under windows 7 64-bit with the latest PyDev (1.5.3.x) and maya 2009_x64. I tried changing the command port around, but still no dice. There isn't any response - it just seems that nothing is sent. Any thoughts??
Not working for me either on win 7 64bit with eclipse 3.5.1.
Hi,
Thank you for the step by step setup!
I got the maya compatibility part working after a while, first it didn't connect because I forgot to press the shelf button to hook up maya with eclipse.
"import maya.cmds as cmds
if cmds.commandPort(':7720', q=True) !=1:
cmds.commandPort(n=':7720', eo = False, nr = True)"
I still have a problem with auto completing commands - beyond import and maya. ones.
I think it's because I cant find the pymel documentation, so I just hooked it up to the main Pymel folder: "C:\Documents and Settings\user\My Documents\python\pymel"
I followed the rest of the steps although I got a little lost on the 2 APIs part, but before I redo those if anyone can give me a hint about where the pymel documentation would be I'd appreciate it.
Thank you!
-N
Hello There;
I Have some troubles with the "import" ...
I added these Libraries
http://img535.imageshack.us/img535/4028/pagey.png
and these Builtins:
http://img171.imageshack.us/img171/5017/builtins.png
But I Have these errors, it works, but I don't Have the Auto-completion ...
http://img683.imageshack.us/img683/7375/demoa.png
Thanks For Help !
Hi,
first of all many thanks for the post, it is really helpful as the I was not able to get the syntax highlighting with the method described in the pymel 1.0 documentation on the pymel website. I experienced the problem that the maya editor plugin apparently does not work with ecclipse 3.5.2., so I downgraded to version 3.4.1, now it works smoothly. Maybe you could add this information to your post.
Again, many thanks !
Doesn't seem to send anything from eclipse to maya in windows 7..
What's really needed is a way to set breakpoints and step through the code as well as create watches and look at touples / dictionaries.
Which is supposed to work with eclipse, and is why I installed it, but without connecting to maya in a way that allows it to execute commands line by line ,and spoon feed maya lines of code it doesn't really work like Visual Studio for the Maya SDK, where you can set through things and watch them execute.
i just updated pydev in eclipse and now it appears that the command to send everything to maya no longer works. the connection and send selected (Ctrl+') still works, but sending everything was a great feature that i constantly used.
cheers,
malcolm.
Worked great at first, got autocomplete on all maya.cmds commands. However after restart eclipse this no longer works, any one know why?
Hi just was wandering whether someone have any experience whether this is working with Maya 2010 or 2011 as well?
The last update is long ago and it seems to be a great tool and I am wandering whether there is a chance to run it as well with the newer version of maya or whether this is gonna die.
This is working for Maya 2011 - Thanks
There is now a Version 3 of Eclipse Maya Editor. This fixes the high machine resources. It adds support for sending both Python AND mel scripts and returing the results back to Eclipse. I've also made it a lot easier to install. You can now use the Install New Software option in Eclipse.
Sorry for the noob question. I have Eclipse 3.6.1 x64 on XP 64 running with jre1.5.0_22. Eclipse is working fine. So I'm trying to get the plugin to load from the plugin directory.
com.myplugin.eclipseMayaEditor_1.0.0.jar
There is no evidence of this plugin loading. No prefs, no nothing in Eclipse. So I'm at a loss. Does anyone have any advise? email if you prefer: jdrouse at g mail
I've tried some older versions of Eclipse. 3.5, 3.2, no dice.
Thanks in advance!
After connecting pydev to maya and sending some test text over, it causes permanent high cpu utilization of eclipse.exe. It seems caused by frequent port communication. I try to set interval higher, 60 sec, but problem remains. Any idea?
I also get high cpu use... temp is getting to 85c+ during summer now...
This looked promising but... another case of abandonware, I'm afraid. As Philipp Ostermaier noted in March 2010, he had to revert Eclipse back to 3.4.1 to get it to work properly; others report partial success with 3.5. In mid 2011, Eclipse is at 3.6.2 and nothing seems to work except the quick access to Maya documentation (which was a nice touch, BTW).
The worst part is the high CPU utilization, as more recent posts have noted. If Maya is open, then the moment you hit that Reconnect Eclipse To Maya button that the plugin provides, Eclipse starts to drop to its knees. Quitting Maya doesn't help, you have to also restart Eclipse. I removed the plugin since I was getting no real benefit and only problems.
I do have partial success with the (completely separate) autocompletion, so I'll leave the editor paths to the stubs in place.
It's actually NOT "abandonware". I created this tutorial because I use this method all the time. This tutorial is already a couple of years old and many versions and releases changed since then so things might not be up to date any longer.
Anything new about this High CPU usage ? I tried on Windows 7 or Linux with both maya 2011 /2012. Also tried with Eclipse 4.1 / 3.7 /3.4.1
Still have the problem as soon as connecting Eclipse with Maya, Eclipse start to use 100% of the process.
Regarding the high CPU usage: I believe it has to do with the way Java listens for changes to the temp file. The temp file is where Maya is outputting the script editor contents.
Thank you for this tutorial, it really helped me get started with Eclipse. I had also been using jEdit for several years. Your plugins are invaluable!
One suggestion for this tutorial is to introduce interactive debugging, here is a great guide that got me started: http://www.jason-parks.com/artoftech/?p=41
Thanks for updating this.
I've got the install partially working with Python. When I mouse over a Maya command, I get the yellow box, but it always says:
"Found at mays.cmds__init__"
Perhaps this is all I can achieve when using python only?
A couple other questions:
1) Can I change the kbs for "send selected text to Maya"
2) Is there a way to get autocompletion of python cmds when using "import maya.cmds as cmds"
I'm happy being able to send commands to Maya, but if I can get more, I'll take it.
Thanks again.
Hey! I got everything working except the autocompletion. I can see the .pypredef loaded in my project on the left, under predefined completions, but for some reason, it doesnt allow me to see these when I either start to type a word or use ctrl-space I dont know if I missed something...
Under interpreter - python, I first had to load C:\Python32\python.exe to allow the Predefined load.
I added pyredef from Maya folders, and the other def from the from the download. ( I tried both, with the Maya, and with the other alone)
I created a new project PyDev Project and created a PyDev module then I tried to type things and see if autocompletion worked. And it didnt....
Any idea would be welcome
Thank you
Thank you so much, great work!
I only have a little problem: when I import an API modules like this:
import maya.OpenMaya as om
the autocompletion fails when typing: om.M... it only works when I import
with :
import OpenMaya as om
How can I make it work correctly? I don't always want to chance the import commants when
I test the plugins in Maya.
Any idea how to fix this?
Eclipse Version: 3.7.1
Maya 2011 API on Win7
Regarding the import paths. I did find there can be slightly different behaviour with the pypredef paths.
The .zip file has a maya/ directory with the OpenMaya*.py libraries inside - this matches the actual Maya library path structure. This is what works for me on Windows.
However, if you are on Linux or if it's not working for you on a Windows machine, then you can rename the stub files to include "maya." in front of each library. pypredef then recognizes this when you import maya.OpenMaya* in Eclipse.
Hey guys my name is hugo and i am try install for 4 weeks and i am having problem to install eclipse in maya on mac all i recieve is this Cannot complete the install because one or more required items could not be found.
Software being installed: EclipseMayaEditor 3.0.0 (org.eclipse.EclipseMayaEditor.feature.group 3.0.0)
Missing requirement: EclipseMayaEditorPlug-in 3.0.0 (org.eclipse.eclipseMayaEditor 3.0.0) requires 'bundle org.eclipse.core.resources 3.7.100' but it could not be found
Cannot satisfy dependency:
From: EclipseMayaEditor 3.0.0 (org.eclipse.EclipseMayaEditor.feature.group 3.0.0)
To: org.eclipse.eclipseMayaEditor [3.0.0]
Hey rbublitz,
Thanks for the tool ! It's great, it changed my life at work ! Running there on windows xp and Maya 2009, working great.
But I can't seem to get it working at home, working with Maya 2009 and windows 7. Any thoughts ?
(I'm using Eclipse 3.7.2 in both case)
Hi rbublitz(Ron),
First of all, thanks for making this plug-in for maya developer like me.
But I having in trouble to connect maya and eclipse and it will be great if you can help me out.
I have two maya installed in my desktop, 2009 and 2011 for windows vista 64bit.
I followed your tutorial to connect between maya 2009 and eclipse through port 7720, and everything seems installed fine except for communication between two.
Is there anyway I can debug this issue or where you can suspect and give me it?
Thank you so much your answer.
Matt,
me too
Missing requirement: EclipseMayaEditorPlug-in 3.0.0 (org.eclipse.eclipseMayaEditor 3.0.0) requires 'bundle org.eclipse.core.resources 3.7.100' but it could not be found
I fixed the "Missing requirement" by installing Eclipse 3.7, which contains 'bundle org.eclipse.core.resources 3.7.100'. I am using that install exclusively as a Maya Python IDE.
Hi!
I'm sorry but i'm stuck here :
5. In Maya, create a new shelf button with the following code or put it in the Startup script
import maya.cmds as cmds
if cmds.commandPort(':7720', q=True) !=1:
cmds.commandPort(n=':7720', eo = False, nr = True)
When a click on the button shelf, i got this error :
// Error: if cmds.commandPort(':7720', q=True) !=1: //
// Error: Line 3.2: Syntax error //
Why ? And is it working with Eclipse Juno ?
Thanks!
I'm at page 2 now, but I get an error message telling me
-Using an unsupported version
Python and Jyton require atleast version 2.1 and iron python version 2.6
-Specifying an invalid intrepeter
(usually a link to the actual interpreter on mac or linux).
and: See error log for details.
A jar cannot be used in order to get the info for the python interpreter.
I don't know why it does this :/ really need some help to get this working because I'm not getting anywhere. I do get > --Connected to Maya-- when I hit the Reconnect Eclipse to Maya button. So it seems that i have a connection, but I can't make a project without a interpreter.
I just don't understand any of those error messages. Sorry.
Nice plugin Rbublitz, many thanks !!!
I'm running Eclipse SDK 4.2.1 x64 and all the icons of your plugin are working fine sending the code to Maya 2013 x64.
The only issue is that I can not make the hotkey Ctrl + Return or any other to work as you've described in the page 1 of
http://www.creativecrash.com/maya/tutorials/using-tools-scripts/c/using-eclipse-as-a-maya-ide
Opening the org.eclipse.eclipseMayaEditor_3.0.0.jar file I can see inside another file called plugin.xml
at the end of it there is a call to the keys but non of them are working in my station.
By the moment I'm just testing this with mel.
Let me know if you know how to fix this.
Kindest regards.
Write a Comment