Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

mayapy on PyDev Maya Python is running on OSX

2008-02-26
2013-03-15
  • Alex Kessaris
    Alex Kessaris
    2008-02-26

    Hello,

    Since initiating the thread about maya python on PyDev, I have managed to get the Hello World program included by Alias to run from Eclipse using PyDev.

    These are the necessary steps:
    Following these steps will enable code to actually execute, BUT.. CODE COMPLETION DOES NOT WORK FOR MOST OF THE MODULES.

    # 1. ######## Installation
    Install PyDev (PyDev Extensions optionally)

    # 2. ######## Preferences
    In the Eclipse Preferences under PyDev Interpreter, Add the path to mayapy. 
    In a default installation of maya on OS X, mayapy is located at:

    /Applications/Autodesk/maya2008/Maya.app/Contents/bin/mayapy

    One trick is to press SHIFT-COMMAND-G at the file browser and type this location in manually.
    It will resolve itself to the following path to python:

    /Applications/Autodesk/maya2008/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python

    and add a bunch of directories to your system PYTHONPATH

    This is good.  You  will also need to include the following forced builtin libs:

    maya.OpenMaya
    maya.OpenMayaAnim
    maya.OpenMayaCloth
    maya.OpenMayaFX
    maya.OpenMayaMPx
    maya.OpenMayaRender
    maya.OpenMayaUI
    maya.standalone
    maya.app
    maya.cmds
    maya.mel

    # 3. ####### Python Run
    Configure a new Python Run configuration
    In Eclipse: Run->Open Run Dialog
    Add a new configuration under Python Run

    Under the Arguments tab:
    Base Directory: /Applications/Autodesk/maya2008/Maya.app/Contents/
    Interpreter: /Applications/Autodesk/maya2008/Maya.app/Contents/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python

    Under the Environment tab:
    DYLD_FRAMEWORK_PATH=/Applications/Autodesk/maya2008/Maya.app/Contents/Frameworks
    DYLD_LIBRARY_PATH=/Applications/Autodesk/maya2008/Maya.app/Contents/MacOS
    MAYA_LOCATION=/Applications/Autodesk/maya2008/Maya.app/Contents
    PYTHONHOME=/Applications/Autodesk/maya2008/Maya.app/Contents/Frameworks/Python.framework/Versions/Current

     
  • Bob
    Bob
    2011-01-20

    Hi,
    I am having some issues trying to do the same thing in Windows XP 32 bit. I got auto completion working but I cannot find any instructions on setting up a run configuration for Windows XP. Is there anyone who can convert these above instructions for Windows XP? I have Windows XP 32 bit running Eclipse 3.6.3, pydev 1.6.3 and Maya 2008. As of right now, if I create a default python run configuration, and press run I get a bunch of errors stating it cannot find the real location of xxx, the x's being the files it cannot find