Skip to content

GuyMicciche/MayaPluginWizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maya Plugin Wizard for Visual Studio 2022/2019/2017

https://marketplace.visualstudio.com/items?itemName=GuyMicciche.MayaPluginWizard

A Visual Studio extension that provides project templates and wizards for creating Autodesk Maya C++ plugins. This extension streamlines the process of setting up Maya plugin development environments with proper project structure and dependencies.

Maya Plugin Wizard

Features

  • Project Templates: Pre-configured project templates for Maya C++ plugin development
  • Wizard Integration: Custom wizard implementation that guides users through plugin creation
  • Maya Integration: Automatically configures Maya SDK references and build settings
  • Visual Studio Support: Compatible with Visual Studio 2022/2019/2017

Maya Versions Supported

MayaIcon

Maya 2026/2025/2024/2023/2022/2020/2019

Prerequisites

  • Visual Studio 2017 or later
  • Autodesk Maya 2019 or later
  • Maya DevKit installed (for more control)
  • .NET Framework 4.7.2 or later
  • Python 3.9 or later (to run unload_plugin.py and load_plugin.py when you build)

Installation

  1. Download the latest VSIX package from the Releases page
  2. Double-click the .vsix file to install the extension
  3. Restart Visual Studio
  4. The Maya plugin templates will appear under Visual C++ templates

Usage

Creating a New Maya Plugin Project

  1. Open Visual Studio
  2. Go to File > New > Project... (Crtl+Shift+N)
  3. Navigate to Visual C++ > Maya templates
  4. Select the desired Maya plugin template
  5. Configure your project name and location
  6. Follow the wizard prompts to configure Maya-specific settings
  7. Set MAYA_LOCATION variable in System Properties > Environment Variables... > System variables (ex. C:\Program Files\Autodesk\Maya2026

Project Structure

The wizard creates a properly structured Maya plugin project with:

YourPluginName/
├── Source Files/
│   ├── pluginMain.cpp
│   └── YourPlugin.cpp
├── Header Files/
│   └── YourPlugin.h
├── Resource Files/
└── packages.config

Dependencies

This extension uses the following NuGet packages:

  • Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime (v17.14.40254)
  • Microsoft.VisualStudio.Interop (v17.14.40260)

Development

Building from Source

  1. Clone this repository
  2. Open the solution in Visual Studio 2022/2019/2017
  3. Restore NuGet packages
  4. To change version number, open MayaPluginWizard.csproj and change the PropertyGroup VsixVersion
  5. Project templates are automatically compressed into .zip files on build, and saved to MayaPluginWizard/ProjectTemplates/Maya directory
  6. To add more project templates, , put them into the ProjectTemplates/Maya folder and add them in the source.extension.vsixmanifest under Assets
  7. Build the Project by selecting the MayaPluginWizard project in the Solution Explorer (Ctrl+B)
  8. Press F5 to run in experimental instance for debugging

Project Components

  • WizardImplementation.cs: Core wizard logic implementing IWizard interface
  • index.html: Extension documentation and help content
  • stylesheet.css: Styling for help content
  • packages.config: NuGet package dependencies
  • ProjectTemplates/Maya folder contains the .zip files that will be included in the build.

Maya Plugin Development

Once you've created a project using this wizard, you can:

  1. Setup System variables System Properties > Environment Variables... > System variables

    • MAYA_LOCATION
    • MAYA_PLUG_IN_PATH
    image
  2. Create or modify userSetup.py to include (or run this maya_commandport_setup.bat:

# userSetup.py
import maya.cmds as cmds

cmds.commandPort(name=":20200", sourceType="mel")
cmds.commandPort(name=":20201", sourceType="python")
  1. Implement your plugin functionality in the generated source files
  2. Add Qt libs to Project > Properties > Linker > Input > Additional Dependencies if you are using Qt (ex: Qt6Core.lib;Qt6Gui.lib;Qt6Widgets.lib)
  3. Build the project (Ctrl+B) to create a .mll file
    • If you have Maya open, unload_plugin.py and load_plugin.py should create a new file, unload the plugin, and the reload it
    • Modify unload_plugin.py if you don't want to create a new file
  4. The .mll file should get copied to MAYA_PLUG_IN_PATH if you set it up correctly. Otherwise, manually copy the .mll file to %USERPROFILE%\Documents\maya\2025\plug-ins folder
  5. Load the plugin in Maya using the Plug-in Manager
  6. Test your plugin functionality

Maya API Integration

The generated projects include:

  • Proper Maya SDK include paths
  • Maya library dependencies
  • Plugin entry point functions
  • Basic plugin structure following Maya conventions

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Qt Integration (Qt Visual Studio Tools only)

These steps are only necessary if you plan on using the Qt Visual Studio Tools in Visual Studio:

  1. Note Qt version for your Maya version:
    • Maya 2026/2025: Qt 6.5.3 (Qt comes in the Maya API SDK's and tools)
    • Maya 2024/2023/2022: Qt 5.15.2 (Qt in Maya directory)
    • Maya 2020/2019: Qt 5.12.5 (Qt in Maya directory)
  2. Install the Qt Visual Studio Tools Visual Studio extension by going to Extensions > Manage Extensions...
  3. Go to Extensions > Qt VS Tools > Qt Versions and choose the Location where qmake.exe and qtpaths.exe are
    • For Maya 2025+ look in the devkitBase/Qt/bin folder, you might have to extract Qt.zip to your devkitBase directory
    • For Maya 2024 and below, look in C:\Program Files\Autodesk\Maya2024\bin folder, should have both files there
  4. If using the devkit (Maya 2025+), download it from The Maya Developer Center and extract somewhere on your disk.
  5. If installing Qt (Maya 2024 and lower), see Installing Qt
  6. Right-click on your C++ project, click Qt > Convert to Qt/MSBuild project
  7. Now every time you compile your project Qt will handle all the Qt specific files automatically (ex: Resources.qrc, converting to moc files, etc.)

Installing Qt

  1. Download Qt for open source use
  2. You will need to create an account.
  3. In the installer when you reach Customize, click Show > Archive and dropdown to Qt > Qt 5.15.2 and check MSVC 2019 64-bit (don't check the entire Qt folder. In addition, you should also check CMake, under Qt > Build Tools > CMake if you don't already have it. Feel free to install Qt 6.5.3 if you want to use this installer for Maya 2025+.
  4. Preferred location is C:\Qt
Screenshot 2025-09-28 230416 5. Click Next, Next, Next, then click Install

Building Qt (Prerequisite download links)

It is recommended to have the basic Qt build on your machine if you want to use the Qt Visual Studio Tools extension and for Visual Studio to compile .moc files and Qt Resources.qrc. You will also need Git and Perl to build to run the commands or batch scripts provided below. However if for some reason you want to build a more complete build, you will need to add the .exe files from Step 4 and edit the batch files to uncomment the Advanced init-repository command.

  1. Git Bash
  2. Strawberry Perl, add .exe to PATH
  3. Ninja, add .exe to PATH (to build Qt 6+ with cmake)
  4. If building QtWebEngine, you will also need to add these .exe to PATH:
    • GPerf, add .exe to PATH
    • Bison, add .exe to PATH
    • Flex, add .exe to PATH

Qt 6.5.3 build for Maya 2026/2025

build_qt_6_5_3_for_maya_2026_2025.bat

Qt 5.15.2 build for Maya 2024/2023/2022

build_qt_5.15.2_for_maya_2024_2023_2022.bat

Qt 5.12.5 build for Maya 2020/2019

build_qt_5_12_5_for_maya_2020_2019.bat


How to manually setup a Visual Studio environment for Maya C++ API and Qt

Visual Studio Suggestion

Visual Studio 2022

Variable Definition

Set in System Properties > Environment Variable... > System variables:

  • $(MAYA_LOCATION) : Your Maya installation directory
  • $(MAYA_PLUG_IN_PATH) : Your Maya plug-ins directory

Configuration

[All Configurations]

General

  • Configuration Properties -> General -> General Properties -> Output Directory -> $(Configuration)\
  • Configuration Properties -> General -> General Properties -> Intermediate Directory -> $(Configuration)\
  • Configuration Properties -> General -> General Properties -> Configuration Type -> Dynamic Library (.dll)
  • Configuration Properties -> General -> General Properties -> C++ Language Standard -> ISO C++17 Standard (/std:c++17)

Advanced

  • Configuration Properties -> Advanced -> Advanced Properties -> Target File Extension -> .mll

C/C++

  • Configuration Properties -> C/C++ -> General -> Additional Include Directories -> %(MAYA_LOCATION)\include
  • Configuration Properties -> C/C++ -> General -> Debug Information Format -> ProgramDatabase (/Zi)
  • Configuration Properties -> C/C++ -> General -> Warning Level -> Level3 (/W3)
  • Configuration Properties -> C/C++ -> General -> Multi-processor Compilation -> Yes (/MP)

Linker

  • Configuration Properties -> Linker -> General -> Additional Library Directories -> $(MAYA_LOCATION)\lib
  • Configuration Properties -> Linker -> Input -> Additional Dependencies -> (Fill below)

Foundation.lib
OpenMaya.lib
OpenMayaAnim.lib (optional)
OpenMayaFX.lib (optional)
OpenMayaRender.lib (optional)
OpenMayaUI.lib (optional)

  • Configuration Properties -> Linker -> Command Line -> Additional Options -> /export:initializePlugin /export:uninitializePlugin

Build Events

Make sure unload_plugin.py and load_plugin.py are in your project directory, with Python installed (not from the Windows Store)

  • Configuration Properties -> Build Events -> Pre-Build Event -> python $(ProjectDir)unload_plugin.py"
  • Configuration Properties -> Build Events -> Post-Build Event -> copy $(TargetPath) "$(MAYA_PLUG_IN_PATH)\$(TargetName)$(TargetExt)" /b /y python $(ProjectDir)load_plugin.py

[Release]

Advanced

  • Configuration Properties -> Advanced -> Advanced Properties -> Use Debug Libraries -> Yes

C/C++

NDEBUG
WIN32
_WINDOWS
_USRDLL
NT_PLUGIN
_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
_SECURE_SCL_THROWS=0
_SECURE_SCL_DEPRECATE=0
_CRT_SECURE_NO_DEPRECATE
TBB_USE_DEBUG=0
__TBB_LIB_NAME=tbb.lib
REQUIRE_IOSTREAM
AW_NEW_IOSTREAMS
Bits64_


[Debug]

Advanced

  • Configuration Properties -> Advanced -> Advanced Properties -> Use Debug Libraries -> No

C/C++

  • Configuration Properties -> C/C++ -> Optimization -> Optimization -> Disabled (/Od)
  • Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions -> (Fill below)

_DEBUG
WIN32
_WINDOWS
_USRDLL
NT_PLUGIN
_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
_SECURE_SCL_THROWS=0
_SECURE_SCL_DEPRECATE=0
_CRT_SECURE_NO_DEPRECATE
TBB_USE_DEBUG=0
__TBB_LIB_NAME=tbb.lib
REQUIRE_IOSTREAM
AW_NEW_IOSTREAMS
Bits64_


Additional Qt Project Qwerks

NOTE: Qt Visual Studio Tools will do all of the following by default if you convert your project into a Qt project.

  • If your project .h files has a Q_OBJECT in it, then a corresponding moc .cpp file will need to be generated. Right-click your .h file with Q_OBJECT and select Properties. Go to Configuration Properties -> General -> Item Type and set it to Custom Build Tool. Click Apply. Then go to Custom Build Tool -> General and enter the following:
    • Command Line: "$(MAYA_LOCATION)\bin\moc.exe" "%(FullPath)" -o "$(ProjectDir)moc_%(Filename).cpp"
    • Description: Running moc on "%(FullPath)"
    • Outputs: $(ProjectDir)moc_%(Filename).cpp
  • If your project has a Resources.qrc in it, then a corresponding moc .cpp file will need to be generated. Right-click your .qrc file and select Properties. Go to Configuration Properties -> General -> Item Type and set it to Custom Build Tool. Click Apply. Then go to Custom Build Tool -> General and enter the following:
    • Command Line: "$(MAYA_LOCATION)\bin\rcc.exe" -name resources "%(FullPath)" -o "%(Filename).qrc.cpp"
    • Description: Converting resource "%(FullPath)"
    • Outputs: %(Filename).qrc.cpp
  • After the first build, you will need to import all the generated .cpp files once. It will always get updated on each build. Again, this is not necessary if you are using the Qt Visual Studio Tools extension for Visual Studio

Qt 6.5.3 Module Mapping (Maya 2026/2025)

Module Provides Include Directories
qtbase QtCore, QtGui, QtWidgets, QtNetwork, QtSql, QtTest, QtConcurrent, QtOpenGL, QtOpenGLWidgets, QtPrintSupport, QtXml, QtDBus, QtDeviceDiscoverySupport, QtFbSupport, QtFreetype, QtHarfbuzz, QtJpeg, QtPng, QtZlib
qtdeclarative QtQml, QtQmlCore, QtQmlModels, QtQmlWorkerScript, QtQmlLocalStorage, QtQmlXmlListModel, QtQmlIntegration, QtQmlCompiler, QtQmlTypeRegistrar, QtQmlDom, QtQmlDebug, QtQuick, QtQuickWidgets, QtQuickTest, QtQuickControls2, QtQuickControls2Impl, QtQuickTemplates2, QtQuickLayouts, QtQuickParticles, QtQuickShapes, QtQuickEffects, QtQuickDialogs2, QtQuickDialogs2QuickImpl, QtQuickDialogs2Utils, QtQuickTestUtils, QtQuickControlsTestUtils, QtPacketProtocol, QtLabsAnimation, QtLabsFolderListModel, QtLabsQmlModels, QtLabsSettings, QtLabsSharedImage, QtLabsWavefrontMesh, QtExampleIcons
qtmultimedia QtMultimedia, QtMultimediaWidgets, QtMultimediaQuick, QtSpatialAudio
qttools QtDesigner, QtDesignerComponents, QtHelp, QtUiTools, QtUiPlugin, QtTools
qtpositioning QtPositioning, QtPositioningQuick
qtserialport QtSerialPort
qtserialbus QtSerialBus
qtsensors QtSensors, QtSensorsQuick
qtwebsockets QtWebSockets
qtwebchannel QtWebChannel
qtwebengine QtWebEngineCore, QtWebEngineWidgets, QtWebEngineQuick, QtPdf, QtPdfQuick, QtPdfWidgets, QtWebView, QtWebViewQuick
qtremoteobjects QtRemoteObjects, QtRemoteObjectsQml, QtRepParser
qtscxml QtScxml, QtScxmlQml, QtStateMachine, QtStateMachineQml
qtspeech QtTextToSpeech
qt3d Qt3DCore, Qt3DRender, Qt3DInput, Qt3DLogic, Qt3DAnimation, Qt3DExtras, Qt3DQuick, Qt3DQuickAnimation, Qt3DQuickExtras, Qt3DQuickInput, Qt3DQuickRender, Qt3DQuickScene2D
qtshadertools QtShaderTools
qtsvg QtSvg, QtSvgWidgets
qt5compat QtCore5Compat

Qt 5.15.2 Module Mapping (Maya 2024/2023/2022)

Module Provides Include Directories
qtbase QtCore, QtGui, QtWidgets, QtNetwork, QtSql, QtTest, QtConcurrent, QtOpenGL, QtOpenGLExtensions, QtPrintSupport, QtXml, QtDBus, QtPlatformHeaders, QtAccessibilitySupport, QtThemeSupport, QtFontDatabaseSupport, QtDeviceDiscoverySupport, QtEdidSupport, QtEventDispatcherSupport, QtFbSupport, QtPlatformCompositorSupport, QtWindowsUIAutomationSupport, QtWinExtras, QtZlib
qtsvg QtSvg
qtmultimedia QtMultimedia, QtMultimediaWidgets, QtMultimediaQuick
qttools QtDesigner, QtDesignerComponents, QtHelp, QtUiTools, QtUiPlugin
qtserialport QtSerialPort
qtserialbus QtSerialBus
qtsensors QtSensors
qtwebsockets QtWebSockets
qtwebchannel QtWebChannel
qtwebengine QtWebEngine, QtWebEngineCore, QtWebEngineWidgets, QtPdf, QtPdfWidgets
qtxmlpatterns QtXmlPatterns
qtnetworkauth (OAuth support)
qtremoteobjects QtRemoteObjects, QtRepParser
qtscxml QtScxml
qtspeech QtTextToSpeech
qtactiveqt ActiveQt (Windows only)
qt3d Qt3DCore, Qt3DRender, Qt3DInput, Qt3DLogic, Qt3DAnimation, Qt3DExtras, Qt3DQuick, Qt3DQuickAnimation, Qt3DQuickExtras, Qt3DQuickInput, Qt3DQuickRender, Qt3DQuickScene2D
qtgamepad QtGamepad
qtlocation QtLocation, QtPositioning, QtPositioningQuick
qtdeclarative QtQml, QtQmlModels, QtQmlWorkerScript, QtQuick, QtQuickWidgets, QtQuickTest, QtQuickParticles, QtQuickShapes, QtPacketProtocol, QtQmlDebug
qtquickcontrols2 QtQuickControls2, QtQuickTemplates2
qtwebview QtWebView

Related Resources

About

Visual Studio extension providing project templates and wizards for Autodesk Maya C++ plugin development

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors