From: http://iwonderwhatjoeisworkingon.blogspot.com/2017/04/debugging-maya-using-visual-studio-code.html
- Install ptvsd
pip install --user ptvsd
- Start ptvsd server in Maya
import ptvsd
ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)
- 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}"
}
]
}
]
}
- Start debugging
- Set break point
- Execute code in Maya