You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to debug our Python code at Maya startup time, in userSetup.py files. With no support for Maya debug configurations, I put a confirmDialog() at the top of userSetup.py, to give me a chance to do the Attach to Process... in PyCharm. However, the attachment won't happen while the confirmation dialog is up. I tried adding a call to maya.utils.processIdleEvents() and a second confirmDialog() after doing the attachment, in hopes that might help, but no.
I'm not sure if the UI confirmDialog() is preventing handling whatever port communication PyCharm is making to the process to connect to the debugger, or if it is simply not attachable until later in startup, after userSetup.py has finished. Is there a way to debug breakpoints in userSetup.py code in the Maya GUI app?
The text was updated successfully, but these errors were encountered:
The same thing happens in code run at evalDeferred time. But even at userSetup time, Python should be fully initialized (sitecustomize has been run, for example), and Maya itself has been set up to the point where it's UI is available for my confirmDialog() call.
I think the problem is that confirmDialog() is locking into some sort of relatively tight event loop. The Python GIL is being held, or some other failure-to-yield scenario is happening. pydevd seems to be doing some complex shenanigans to execute some code in the context of the mayapy process, and I suspect that while the confirmDialog() is being displayed, mayapy isn't able to respond to that as it would otherwise.
I may try to replace the dialog with a 30-second loop that calls processIdleEvents() and anything else that might help yield, and see if the attach works then. I can also try doing a mayapy Python Console in Pycharm and use the Attach in that, before calling maya.standalone.initialize() to start Maya up - if that works than it will at least let me debug the part of the startup code that isn't doing UI stuff.
I'm trying to debug our Python code at Maya startup time, in userSetup.py files. With no support for Maya debug configurations, I put a confirmDialog() at the top of userSetup.py, to give me a chance to do the Attach to Process... in PyCharm. However, the attachment won't happen while the confirmation dialog is up. I tried adding a call to maya.utils.processIdleEvents() and a second confirmDialog() after doing the attachment, in hopes that might help, but no.
I'm not sure if the UI confirmDialog() is preventing handling whatever port communication PyCharm is making to the process to connect to the debugger, or if it is simply not attachable until later in startup, after userSetup.py has finished. Is there a way to debug breakpoints in userSetup.py code in the Maya GUI app?
The text was updated successfully, but these errors were encountered: