This post is not about creating a C++ Maya plugin, it is aimed at setting up debugging in Visual Studio for the plugin.
note: If you see the word “MayaMorph” in this post, it is because the project I am building is morphing between two geometric meshes. If you are interested there is more info on my website https://nickcullen.net.
We start off in Visual Studio. Open up your Maya plugin solution.
1. Right click your plugins project properties
2. Under Configuration Properties -> Debugging set the "Debugger to launch" option to "Local Windows Debugger".
3. In the "Remote Command" entry, you want to put the full path (including extension) to the maya executable. For example my Maya is located at "C:\Program Files\Autodesk\Maya2016\bin\maya.exe" (Yours may be different!).
A handy trick to get the the full path to a file on your windows machine is to hold shift + right click on the executable, then click “Copy as Path“. You can simply paste the value into “Remote Command” removing any quotation marks.
4. Set the "Attach" value to "Yes". This option attempts to attach the debugger to an already running Maya instance. Without this, it will launch Maya every time you launch the debugger.
Your values should look similar to these:
Your debugger is all set up.
If you haven’t done so yet, set some breakpoints and open Maya. Don’t run the debugger until Maya is fully open.
Debugging Maya Plugin
Once Maya is fully open, plugin compiled and loaded you can attach the debugger.
1. Click the "Local Windows Debugger" option at the top or simply hit F5
Once you execute your plugin from within Maya, you should hit one of your break points like so.