Maya Python: Visual Studio 2012

Setup Visual Studio to write python code for Maya in 5 steps

1

Instal the Python Tools for Visual Studio. This is a free plugin that turns Visual Studio into a python IDE.
- Create a new Python Project in VS. Open the properties of your project.
- Under the Debug menu add the following to your search paths (or in the Solution Explorer):
C:\Program Files\Autodesk\Maya20##\Python\lib\site-packages.
- You can also put in the Interpreter Path for the standalone setup:
C:\Program Files\Autodesk\Maya2012\bin\mayapy.exe

2

You can Debug your python code by clicking Attach to Process under the Debug menu. Choose for the Maya script editor

3

For fast script execution I wrote a plugin for Visual Studio 2012 called ToMaya. With this plugin you can easily execute your python script directly in Maya.

4

Maya python command completion. Add the the following paths to the search paths:

  •  Maya 2012

…\PyMel-1.0.2\extras\completion\py\maya\
…\Python\Lib\site-packages\PyQt4\

  •  Maya 2013

C:\Program Files\Autodesk\Maya2014\devkit\other\pymel\extras\completion\py\maya

5

I also wrote a add-in for Visual Studio 2012 MayaPythonDoc to easily open the python command documentation.
- Unzip the file in Documents\Visual Studio 2012\Addins\
– In Visual Studio go to Tools -> Options -> Environment -> Add-in Security
– Add the path where the files are.
– Go To Tools -> Add-in Manager… and check start for the new add-in.
– Restart Visual Studio

3 thoughts on “Maya Python: Visual Studio 2012

  1. Ionut-Stefan Dinu says:

    Hi!

    Download links don’t work….

  2. rob says:

    Hi,

    Thx for your help on connecting visual studio to maya !.

    Note : The MayaPythonDoc link seems broken.

    Best,
    Rob

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>