…with as little hair pulling as possible…
So, setting up an IDE for doing coding is a pretty good idea if you’re gonna be doing a lot of it. My IDE of choice is Wing and it can be a little tricky getting things setup right for auto-completion. If you wanna get going with it, you can…
- First download it from their site
- Add maya’s mayapy exec as a custom Python Executable in Project Properties>Enviornment
- Add your repository as a custom Python path in the same section – in my case ‘J:\repos\cgmtools\mayaTools’
- Next see their doc page for maya for help
- I had to change one item for my own setup. Maya 2011′s pi file location ended up being:
C:\Program Files\Autodesk\Maya2011\devkit\other\pymel\extras\completion\pi
- I had to change one item for my own setup. Maya 2011′s pi file location ended up being:
- Add your own computer’s path in Preferences>SourceAnalysis>Advanced>Insert and put that path in there and you should be golden
If you have to generate your own pi files for whatever reason…
Start with the tutorial here to get you most of the way there.
- Now, when get to the the part about the genmayapi thing, you’re gonna wanna edit it cause it won’t work off the bat depending on your version of Wing.
- Lines 5 and 7 will need to be modifed to your version of Wing. In my case, it was ‘Wing IDE Personal 4.1′
- Line 12 will again need soe work, in my case it was ‘Wing Personal 4′.
You can find the folder directly in windows at C:\Users\%Name%\AppData\Roaming.
- After those fixes you should be able to run the genmayapi and finish out the tutorial without issue.
This was my genmayapi.py:
import os import sys import maya.standalone WING_DIR = r'c:\Program Files (x86)\Wing IDE Personal 4.1' if not os.path.exists(WING_DIR): WING_DIR = r'c:\Program Files\Wing IDE Personal 4.1' sys.path.append(os.path.join(WING_DIR, 'src', 'wingutils')) import generate_pi PI_FILES_DIR = os.path.join(os.environ['AppData'], 'Wing Personal 4', 'pi-files') MOD_LIST = [ 'maya.OpenMaya', 'maya.OpenMayaAnim', 'maya.OpenMayaCloth', 'maya.OpenMayaFX', 'maya.OpenMayaMPx', 'maya.OpenMayaRender', 'maya.OpenMayaUI', 'maya.cmds', 'maya.standalone', ] def main(): maya.standalone.initialize() for mod in MOD_LIST: pi_filename = os.path.join(PI_FILES_DIR, os.sep.join(mod.split('.')) + '.pi') if not os.path.isdir(os.path.dirname(pi_filename)): os.makedirs(os.path.dirname(pi_filename)) print 'Generating .pi file for', mod f = open(pi_filename, 'w') try: generate_pi.ProcessModule(mod, file=f) finally: f.close() if __name__ == '__main__': main()
Happy coding!