Skip to content

Instantly share code, notes, and snippets.

@nafeesb
Last active March 30, 2024 06:44
Show Gist options
  • Save nafeesb/19a1d07fe35fb018d23779fe7c8865e5 to your computer and use it in GitHub Desktop.
Save nafeesb/19a1d07fe35fb018d23779fe7c8865e5 to your computer and use it in GitHub Desktop.

Revisions

  1. nafeesb revised this gist Jun 11, 2019. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions MayaDebug.md
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,6 @@ ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)
    3. VSCode debug config
    ```json
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
  2. nafeesb created this gist May 29, 2019.
    38 changes: 38 additions & 0 deletions MayaDebug.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    From: http://iwonderwhatjoeisworkingon.blogspot.com/2017/04/debugging-maya-using-visual-studio-code.html

    1. Install ptvsd
    ```bash
    pip install --user ptvsd
    ```
    2. Start ptvsd server in Maya
    ```python
    import ptvsd
    ptvsd.enable_attach(address=('0.0.0.0', 3000), redirect_output=True)
    ```
    3. VSCode debug config
    ```json
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Python: Remote Attach",
    "type": "python",
    "request": "attach",
    "port": 3000,
    "host": "localhost",
    "pathMappings": [
    {
    "localRoot": "${workspaceFolder}",
    "remoteRoot": "${workspaceFolder}"
    }
    ]
    }
    ]
    }
    ```
    4. Start debugging
    5. Set break point
    6. Execute code in Maya