"""Run this inside interactive Maya (Script Editor, Python tab) to enable the "Maya: Attach (debugpy)" launch config in .vscode/launch.json. One-time setup -- install debugpy into Maya's own Python environment (adjust the path for your Maya version): "C:\\Program Files\\Autodesk\\Maya2024\\bin\\mayapy.exe" -m pip install debugpy Then, each Maya session, before attaching from VS Code: exec(open(r"C:\\workspace\\PoseRenderer\\scripts\\start_debug_server.py").read()) Breakpoints hit in plug-ins/ or python/openpose_renderer/ (e.g. inside draw_override.py's prepareForDraw, or a command's doIt) will then pause in VS Code once you run "Maya: Attach (debugpy)". """ import debugpy _ALREADY_LISTENING_ATTR = "_openpose_renderer_debugpy_listening" if not getattr(debugpy, _ALREADY_LISTENING_ATTR, False): debugpy.listen(("localhost", 5678)) setattr(debugpy, _ALREADY_LISTENING_ATTR, True) print("[openpose_renderer] debugpy listening on localhost:5678 -- " "run 'Maya: Attach (debugpy)' in VS Code to connect.") else: print("[openpose_renderer] debugpy already listening on localhost:5678.")