AlansCodeLog / blender-debugger-for-vscode

Blender addon for remote debugging Blender with VS Code (and Visual Studio)
GNU General Public License v3.0
302 stars 36 forks source link

Switch to debugpy #24

Closed tettoffensive closed 2 years ago

tettoffensive commented 2 years ago

ptvsd has been deprecated in favor of debugpy

AlansCodeLog commented 2 years ago

Thank you for the pull request. I tested and it seems to work fine* except for the freezing while waiting for attach.

* There are some minor unrelated issues I found testing with 3.0 that I'll need to fix before creating a release.

tettoffensive commented 2 years ago

Yea. Maybe there's another way to get it to wait with a timeout. I just noticed in debugpy's example they use that method to wait indefinitely but it blocks use of blender. Not ideal.

AlansCodeLog commented 2 years ago

There's no need to wait in our situation, unless you have some specific use case for it, otherwise that line can just be removed. It's not like we can't first enable this addon then enable the addon we'll be debugging. I believe wait_for_client exists for when running things from a script where you don't want immediate execution but have no control over when the execution happens.

Also the addon already uses a timeout to give some feedback of when a client attaches because neither ptvsd or debugpy offer some way to get notified when a client has attached. ptvsd/debugpy keep working regardless of if the timer checks anything is connected, if that makes sense. Once the server is running it can't be stopped, clients can connect at any time.

tettoffensive commented 2 years ago

Makes sense. I'll remove that line

AlansCodeLog commented 2 years ago

Ok, I've manually merged it.