Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Dear c4d fellows, Long ago I wrote a simple plugin for cinema4d in python. I didn't know how to code python back then, and learned it while writing the plugin. So I didn't even know how to debug the .pyp file in debugging mode. Now I decided to improve it. The question is: how to set up a debugging mode (the analogue of visual studio for c4d but for python). Is it possible? (I mean going line by line through pyp file and see the values of local variables in console)
Yaroslav.
Hi @Yaroslav this is indeed possible however a bit clunky for the moment, but here a full step by step.
c4dpy -m ensurepip
c4dpy -m pip install ptvsd
launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Cinema 4D: Remote Debugger Attacher", "type": "python", "request": "attach", "connect": { "host": "127.0.0.1", "port": 3000 }, "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "." } ] }, ] }
import ptvsd ptvsd.enable_attach(address = ('127.0.0.1', 3000))
Cinema 4D: Remote Debugger Attacher
Note this also works nicely for the script, however for script you should call ptvsd.wait_for_attach() after the ptvsd.enable_attach.
ptvsd.wait_for_attach()
ptvsd.enable_attach
Cheers, Maxime.