Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Syntax highlight in VS Code under MacOS

    Cinema 4D SDK
    python macos
    3
    4
    740
    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.
    • bacaB
      baca
      last edited by

      Hi,
      I just installed MacOS (MBP M1) from scratch, and looking for syntax highlighting in VS Code.
      Official c4dpy Manual doc has no instruction for MacOS.
      When trying to set interpreter to /Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy I get this error

      2024-11-09 22:17:14.074 [info] > "/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I ~/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py
      2024-11-09 22:17:29.115 [error] [Error: Command failed: "/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py
      sysctl: No such file or directory
      	at genericNodeError (node:internal/errors:984:15)
      	at wrappedFn (node:internal/errors:538:14)
      	at ChildProcess.exithandler (node:child_process:423:12)
      	at ChildProcess.emit (node:events:531:35)
      	at maybeClose (node:internal/child_process:1105:16)
      	at ChildProcess._handle.onexit (node:internal/child_process:305:5)] {
        code: null,
        killed: true,
        signal: 'SIGTERM',
        cmd: '"/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py'
      }
      

      Several years ago I deal with python package symlink if I remember correctly, but I can't find this instruction anymore.
      Would be thankful for any suggestion.

      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @baca
        last edited by

        Hi @baca,

        The expected workflow to achieve syntax highlighting in VSCode is using our C4D Connector Extension for VSCode. Please note, for syntax highlighting to work your VSCode need to be opened within some workspace (e.g. when you do "Open folder" in VSCode).

        The approach from the c4dpy manual should still be working and the error you're sharing looks like command

        "/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I
        

        did not make an output that's expected by the VSCode. Please use the extension approach instead.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 1
        • bacaB
          baca
          last edited by

          Thanks, I forgot about the extension.
          I didn't use the connection to Cinema4D, but syntax highlighting works just fine.

          1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand
            last edited by ferdinand

            I would heavily recommend using the extension, as it will automatically curate the paths for you. I.e., when you use the extension and connect to a Cinema 4D instance, it will make sure that the dummy modules of that Cinema 4D version are on the search paths.

            But when you really do not want to use it, you can also just edit your config so that the dummy module paths are discoverable for auto complete and the linter.
            2a76cd6c-35aa-451f-82db-02b03694e72d-image.png

            What you will need in any case, is the Python and Pylance extension for VS Code, as they are the extensions which make use of these settings. When you install the connector, they will be installed automatically as a dependency.

            0b5d77af-5f23-4203-9a0a-276b8eafc62e-image.png

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

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