![]() To avoid running into the same problem again, let's add an if statement to check whether the time equals zero. You can also see in the debugger, that the value self.time is equal to zero: Surrounding code The debugger also shows the error message. Another breakpoint appeared as well: by default P圜harm will halt for any exception that wasn't caught in your code, and it'll show an icon of a breakpoint with a lightning bolt. ![]() ![]() P圜harm starts a debugging session and shows the Debug tool windowĬlick the button to proceed with the script execution and in the Console tab, enter S and press Enter:Ĭlick the button to resume the script execution. Next, click the icon in the gutter, next to the main clause, and choose Debug 'Car'. To create breakpoints, just click in the gutter To start debugging, you have to set some breakpoints first. We can use the P圜harm debugger to see exactly what’s happening in our code. Let’s dig a little deeper into our code to find out what’s going wrong. P圜harm reports a runtime error: a ZeroDivisionError. Start the script you want to debug (the script opened at step 4.).Let's see what happens when we start our script up, and try to find out the average speed by typing s in the command line:.I wrapped this command in a Shelve so it is easier to call it. In order to do so, you can run a particular Python command. Start Maya and connect PyDev to the Remote debugger you have established in P圜harm.Easy way to do this is to add a userSetup.py scripts in your maya config folder (C:\Users\phaneus\Documents\maya\2015-圆4\scripts). Ensure your maya python path contains the path to P圜harm pydev libraries (C:\Program Files (x86)\JetBrains\P圜harm 3.4.1\helpers).P圜harm, open the Python project you are trying to debug.Uncheck both “Redirect to console Input” and ”Suspend after connect”. Setup a Remote Debugging Configuration: Run-> Edit Configurations.In P圜harm, setup the Maya Interpreter as the default P圜harm Interpreter (File-> Settings -> Project Interpreter). ![]() ![]() First Get P圜harm Professionnal (the version of P圜harm that supports Remote Debugging) Download Pycharm.The following will illustrate how to setup the Python IDE P圜harm to debug Shotgun scripts running inside Autodesk Maya. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |