AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Vscode debug python script8/18/2023 ![]() ![]() So depending on your needs you can go with pdb, or with Visual Studio Code. ![]() You need to launch it from terminal and at breakpoint you can type pdb commands into the terminal. In Nuke I did not manage to get pdb working. In Maya pdb seems to work fine, so it is equivalent option for debugging. When executing commands from Python Shell, it seemed to work fine. I tested it from Shelf Tool and Python Sop. Houdini can import pdb and break into set_trace() breakpoint, but then it usually freezes after running commands from pdb. Disadvantage is that it does not enable you to debug scripts running in contexts, where you do not have command line access ( remote_pdb might help though).Īnother issue is that it does not work properly from Houdini. It has one advantage, that it is present in every application, which has Python, so there is no additional setup required. It enables you to set breakpoints, inspect variables and other common debugging actions. Pdb is very useful module coming with Python standard library. You can find a list of more tools here.Īlso one note – I do not pretend to be a debugging expert, so if you know solutions for problems I encountered or have any suggestions, then feel free to correct me □ One of other IDEs which provide this functionality is P圜harm by JetBrains, it is however available only in commercial version. It is simple to setup and intuitive to visually debug flow of your script. I tested it on couple of VFX-related applications, but the process should be the same for any other app. It contains a set of tools for attaching its Python debugger into a remotely executed program. Luckily for us Visual Studio Code has a nice support for remote debugging. Remote debuggers enable you to debug Python scripts which are executed by a different process or even on a different computer (might be a script at renderfarm). In this article I will focus mostly on remote debuggers, but I will also mention pdb. In that case you can either use Python Debugger (pdb), or remote debugging. In this case you cannot execute your scripts from IDE as they might depend on modules provided by the application ( hou module in Houdini, nuke module in Nuke, bpy in Blender…). But when programming for VFX applications you might often use application APIs and your scripts are usually called from the application, not as standalone. In most Python IDEs you have a built-in debugger, which enables you to execute a script, set breakpoints, examine local variables, do steps in execution… It is fairly straightforward to debug an application, which is executed from an IDE. UPDATE 2: mentioned Motion Builder and other packages UPDATE 1: added new image :), fixed typo in pip command, mentioned other ways of pointing to ptvsd module, compared VSCode debugging to pdb. I will cover remote Python debugging from Visual Studio Code and configuration of applications. In this guide I will show you how you can debug Python scripts in various VFX DCC applications, like Houdini, Nuke, Maya and Blender. ![]()
0 Comments
Read More
Leave a Reply. |