Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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