-
Dear community,
I'm trying to setup VS Code as outlined in the Documentation here.I have the Cinema 4D Connector extension installed, and the script is successfully executed when i click on Debug in Cinema 4D, but it seems like my breakpoints are disregarded.
I then added the launch.json with the code from the Documentation link above to my workspace, but the behavior is the same.
Please see the video for clarification:
Reproduction
To recreate please follow these steps:
- In Cinema 4D:
- Open the Script Manager.
- Save a simple script (see below for the exact script I used)
- Start Code Exchanger
- Open the scripts folder in VS Code:
- Connect Cinema 4D Connector to the running C4D instance
- Back in Cinema 4D:
- Click Send to IDE in the Script Manager
- Back in VS Code:
- In the now open script, set two breakpoints (line 9 and 10)
- Click Debug in Cinema 4D
EXPECTED: I would like the script to break first in line 9 and then in line 10 to be able to inspect the values of greeting and target in the Run and Debug panel.
ACTUAL: The script runs completely and I don't see any information on the state of the mentioned variables. I get a notification saying:We noticed you are attaching to ptvsd (Python debugger), which was deprecated on May 1st, 2020. Use debugpy instead.
- Still in VS Code:
- Disconnect the debugger.
- Go to the Run and Debug panel
- Create a launch.json file
- Replace the contents of the launch.json file with the code from the Documentation and save the file.
- Go back to the saved script and try running Debug in Cinema 4D again.
RESULT: Same as after step 4.
System
I'm on macOS Tahoe (Version 26.2)
Cinema 4D 2026.1.2 (Build 2026_1_2_e960bfd939c3_2264416005) OSX
Visual Studio Code Version: 1.108.2 (Universal)
Cinema 4D Connector Version 1.2.2Test Code
import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: """Called by Cinema 4D when the script is being executed. """ greeting = 'Hello' target = 'Cinema4D' print(f'{greeting}, {target}!') if __name__ == '__main__': main()I'm really sorry if i overlooked anything obvious, or am missing the point altogether. Either way, any help/pointers in the right direction would be greatly appreciated.
Thank you all very much in advance for your time and consideration.
Best,
Julius - In Cinema 4D:
-
Hey @idealflaw,
Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
- Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
- Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
- Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.
It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: How to Ask Questions.
About your First Question
Thank you for reaching out to us and please excuse the delay. But for now I can only confirm the issue, as I have no found a quick fix for this. Oddly enough, on my machine it does not work, but on the machine of a colleague it does. My hunch would be that either something (firewall) is interfering with the debugger server communication or VS Code mixes something up with the vanilla CPython environment. But that cannot really be, because then the code should not run due to missing dependencies. I also tried making the launch environment explicit but that did not do anything either (no surprise again because it does find the C4D python environment with an explicit
launch.json, otherwise the code would not run at all).This problem only exists on MacOS, Windows is not affected. I have moved this topic into bugs and I cannot give an ETA when we will fix this.
Sorry for the trouble,
FerdinandReproduction Steps
- Attach to VS Code to Cinema 4D 2026.1 on MacOS.
- Run the script attached below and that a breakpoint on line 10.
- Run the script with the debugger attached.
Result
- The debug environment will open and the debugger will attach.
- The code will neither halt on the manual stop set one line 10, nor on the raised exception. It will just run as if it would be running without a debugger.
OK Windows 2026.1
NOK MacOS 2026.1import c4d def main() -> None: """Called by Cinema 4D when the script is being executed. """ a: int = 42 b: float = 3.14 c: float = a + b if c > 45: raise ValueError("c is too large!") else: print(f"c is {c}.") if __name__ == '__main__': main() -
F ferdinand moved this topic from Cinema 4D SDK