Sublime Text 2 is a really great text editor. If you haven’t tried it, do yourself a favor! Here is a guide to get you setup for Maya scripting. It includes auto complete for PyQt and maya.cmds/mel; and ctrl+enter communication with Maya. It took a bit of googling and fiddling to get this working, so hopefully I can save you some time and frustration.
1) First, get Sublime Text 2. It has an infinite trial period. If you like it, support it by buying it.
2) Get package control . Once its installed, press ctrl+shift+p in Sublime Text and start typing “package.” If you want, go to “Package Control:Discover Package” to browse the huge list of plugins.
3) UPDATE: I’m using Jedi now, its a much easier setup Here’s the github page, you can also install it through package control. Be sure to add to add ‘C:/Program Files/Autodesk/Maya[VERSION]/devkit/other/pymel/extras/completion/py/’ to the paths (see github for setup instructions)
3) Press ctrl+shift+p, start typing “package”, go to “Package Control:Install Package” and press enter. Now start typing “codeintel” and select “SublimeCodeIntel.” Let it install.
4) I had to remove some files from code intel to get it to work. The files were throwing errors so I just removed them and it worked. So go to “…\AppData\Roaming\Sublime Text 2\Packages\SublimeCodeIntel\libs\codeintel2” (You can easily navigate to this folder from Sublime Text 2 by selecting Preferences>Browse Packages) and take out “lang_css.py” and “lang_less.py” and their respective .pyc files.
5) Place pyqt4.cix in “…\AppData\Roaming\Sublime Text 2\Packages\SublimeCodeIntel\libs\codeintel2\catalogs” (You can easily navigate to this folder from Sublime Text 2 by selecting Preferences>Browse Packages). This .cix file is a catalog of pyqt for auto complete. I originally found it on wuub.net. In the version you can download here I changed one line to make it work. I edited the “name” attribute to the value “PyQt4”. All other cix files I found on the web didn’t work properly and using codeintel’s gencix.py utility created an incomplete cix. This does it right!
6) Navigate to “C:\Users\[WHATEVER]\Documents\.codeintel” and edit the config file to look like this (change the paths to fit your environment):
{
“Python”: {
“python”: ‘C:/Python26/python.exe’,
“pythonExtraPaths”: [
‘C:/Python26/Lib/site-packages’,
‘C:/Program Files/Autodesk/Maya2013/devkit/other/pymel/extras/completion/py/’
]
}
}
Note: The first time code intel tries to auto complete something, it will take a while. Especially the PyQt4.cix file. It may seem like its not working even after it completes loading, but try it a few times. Eventually if it really isn’t working, check out the log in “C:\Users\[WHATEVER]\Documents\.codeintel”
7)UPDATE: SublimeMaya is now in package control too. It shows proper stack trace and line number, so you can ignore this step. Now you need to get Sublime Text 2 to communicate with Maya. Get MayaSublime. In the plugin (which you can easily access from Sublime Text 2 via Preferences>Browse Packages), I edited the MayaSublime.py file so that it provides stack trace and the proper line number in the stack trace. You can download my version here. Thanks to Justin Israel for writing this. I also put cmds.commandPort(name=”:7002″, sourceType=”python”) in my userSetup.py script for convenience.
I hope this helps! If you have any additional things you’ve done with Sublime Text 2 to help with Maya development, let me know in the comments.