Dugan Chen's Homepage

Various Things

Building 64-bit Maya 2012 plugins with Visual Studio 2010 Express

This is how you use Visual Studio 2010 Express to build plugins for the 64-bit version of Maya 2012.

Requirements

To build 64-bit targets, Visual Studio Express requires the Microsoft Windows SDK. The current version is 7.1. Install it too.

Strategy

The idea is to build a 64-bit DLL and link it against Maya’s libraries. The DLL needs to have an .mll extension: the extension of a Maya plugin.

Procedure

Here is a demonstration. It is available in 1080p, and should be watched in a high enough resolution to read the text (ideally 1080p). If you’re not on Windows, then I recommend requesting it in HTML5 format (by joining Youtube’s HTML5 beta).

Follow along:

  1. start a new empty project
  2. add a source file
  3. right-click on the project and choose “properties”
  4. pull up the “configuration manager”
  5. from “active solution platform” choose “New”
  6. choose “x64” from the dropdown list
  7. return to the project properties
  8. set the target extension to “.mll”
  9. set the platform toolset to “Windows7.1 SDK”
  10. set the configuration type to “dynamic link library (.dll)”
  11. move to the VC++ Directories panel
  12. append “;c:\program files\autodesk\maya2012\include” to the include directories
  13. append “c:\program files\autodesk\maya2012\lib” to the library directories
  14. navigate to C/C++ and Preprocessor
  15. append “;NT_PLUGIN” to preprocessor definitions
  16. navigate to Linker and Input
  17. append to additional dependencies the following list: “;Foundation.lib;OpenMaya.lib;OpenMayaUI.lib;OpenMayaAnim.lib;OpenMayaFX.lib;Open­MayaRender.lib;Image.lib”

Your build will now succeed.

Resources

Here are the two main resources I referred to when writing this:

  • How to prepare Visual Studio 2005 for Maya C++ API without Maya plug-in wizard PDF
  • How to compile a 64-bit application using Visual c++ 2010 Express? Thread