Build a sample Maya plug-in that uses the Maya API based on C++

TOC

Summary

Learn how to build Maya plugins.

Prerequisites

  • Maya 2022
  • Visual Studio 2019
    • Require Desktop development with C++ on Visual Studio Installer
  • Windows 10 v21H1

Steps

Setup Maya devkit

Download Maya 2022 devkit from Maya Developer Center.

Add DEVKIT_LOCATIONto environment variable of Windows.

In next step, you’ll use cmake command to create a Visual Studio solution file.
So, add cmake path to Path of Environment Variables.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe

Generate project file with cmake

Open command prompt and run commands.

cd C:\devkit\Autodesk_Maya_2022_DEVKIT_Windows\devkitBase\devkit\plug-ins\
cmake . -Bbuild -G "Visual Studio 16 2019"

Build sample maya plugin

Open Plugins.slnin the following directory.

C:\devkit\Autodesk_Maya_2022_DEVKIT_Windows\devkitBase\devkit\plug-ins\build

Build helloWorldCmd on Visual Studio.

Visual Studio make helloWorldCmd.mllin the following directory.

C:\devkit\Autodesk_Maya_2022_DEVKIT_Windows\devkitBase\devkit\plug-ins\build\helloWorldCmd\Debug

References

Let's share this post!
TOC
閉じる