cheind / pytorch-blender

:sweat_drops: Seamless, distributed, real-time integration of Blender into PyTorch data pipelines
MIT License
568 stars 44 forks source link

Debugging cartpole.blend.py in VScode #10

Closed TaeilJin closed 3 years ago

TaeilJin commented 4 years ago

Hi

I have a question about debugging issue I met with cartpole example.

I use docker, and IDE is a VScode.

I try to debug the function inside a "cartpole.blend.py", but breakpoints are not working.

What I've figured out so far is that "cartpole.blend.py" is executed as command by subprocess.Popen(cmd,..).

I am a beginner, so It will be a silly question though.

Is there any way to debug the remote code which executed by command? Could you tell me which is your IDE for this project?

cheind commented 4 years ago

Hey and sorry for the late reply!

The content of cartpole.blend.py will indeed be run in a separate Blender process. So to slighlty reformulate your question: how can I debug a subprocess in Python. Unfortunately, I have no definite answer for that. But maybe this will help

https://stackoverflow.com/questions/4716533/how-to-attach-debugger-to-a-python-subproccess

In case you have some insights, let us know. I'm pretty sure other are struggling from the same issue.