Skip to content

Instantly share code, notes, and snippets.

@mikowmai
Forked from nafeesb/MayaDebug.md
Created May 6, 2021 18:17
Show Gist options
  • Save mikowmai/ed093f2ce5f644797988620c93920296 to your computer and use it in GitHub Desktop.
Save mikowmai/ed093f2ce5f644797988620c93920296 to your computer and use it in GitHub Desktop.
Maya python interactive debugging with Visual Studio Code

From: http://iwonderwhatjoeisworkingon.blogspot.com/2017/04/debugging-maya-using-visual-studio-code.html

  1. Install ptvsd
pip install --user ptvsd
  1. Start ptvsd server in Maya
import ptvsd
ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)
  1. VSCode debug config
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Remote Attach",
            "type": "python",
            "request": "attach",
            "port": 3000,
            "host": "localhost",
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "${workspaceFolder}"
                }
            ]
        }
    ]
}
  1. Start debugging
  2. Set break point
  3. Execute code in Maya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment