Isotropix Forums

Remote debugging from VSCode with ptvsd?

Clarisse Scripting related topics

Remote debugging from VSCode with ptvsd?

Unread postby atnreg » Wed Oct 30, 2019 4:22 pm

Hi!

I read a very interesting article about debugging practically any Python code inside any Python-based application.
https://jurajtomori.wordpress.com/2018/06/13/debugging-python-in-vfx-applications/

I started by installing the ptvsd and then tried
import ptvsd
in Clarisse and it did not give any errors so it was promising :)

Then I followed the instructions (there was no instructions for Clarisse but the process is similar so I adapted the instructions) and made the test script.
Everything went fine, also running the enable_attach() worked as the print after that appeared in the log.

Then I set up VSCode and it also seemed fine, slightly different configuration needed for latest VSCode but no big deal.

Then I started the debug_script in Clarisse by a button and Clarisse freezed the button which was normal according to the instructions.
But when I launched the configured debug in VSCode, it never got the connection :(

Before I waste a lot more of time on this, can you please confirm if this is supposed to work in Clarisse at all?
I really hope it it should work because it would be huge help for developing scripts :)

Thank you, waiting eagerly for any comments, including any other way to debug Python scripts inside Clarisse :)
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0SP5b,Houdini,Blender2.80,Fusion360,Onyx,ZBrush,SubstPnt...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 533
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

Re: Remote debugging from VSCode with ptvsd?

Unread postby ayanik » Wed Oct 30, 2019 4:37 pm

I don't think you can. Spawned threads are immediately killed. That's why I had to do the Megascans Bridge socket listener in a separate process outside of the Clarisse environment.

No other way but the hard way I think.
ayanik
 
Posts: 71
Joined: Wed Nov 26, 2014 9:10 pm

Re: Remote debugging from VSCode with ptvsd?

Unread postby atnreg » Wed Oct 30, 2019 4:58 pm

ayanik wrote:I don't think you can. Spawned threads are immediately killed. That's why I had to do the Megascans Bridge socket listener in a separate process outside of the Clarisse environment.

No other way but the hard way I think.


Thank you very much for FAST reply, I was afraid of that but wanted to be sure :)

I will not waste more time on this unless someone tells otherwise, any comments/ideas on Python debugging in Clarisse are very welcome :mrgreen:

Thank you!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA GTX 1080ti,Win10
Clarisse 4.0SP5b,Houdini,Blender2.80,Fusion360,Onyx,ZBrush,SubstPnt...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 533
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland


Return to Scripting