Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Debugging in VS Code does not pause at breakpoints

    Scheduled Pinned Locked Moved Cinema 4D SDK
    2026pythonmacos
    1 Posts 1 Posters 11 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I Offline
      idealflaw
      last edited by

      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:

      1. In Cinema 4D:
        • Open the Script Manager.
        • Save a simple script (see below for the exact script I used)
        • Start Code Exchanger
      2. Open the scripts folder in VS Code:
        • Connect Cinema 4D Connector to the running C4D instance
      3. Back in Cinema 4D:
        • Click Send to IDE in the Script Manager
      4. 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.

      1. 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.2

      Test 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

      1 Reply Last reply Reply Quote 0
      • First post
        Last post