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

    how to import c4d on my python project

    Cinema 4D SDK
    r19 python
    2
    6
    2.5k
    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.
    • Z
      zhhm156
      last edited by m_adam

      Hi guy:
      i am a new python learner but i have no idea how to install c4d python sdk.I have found some information about python tutorials,however it said "no module named c4d" when i import C4D in my PyCharm, my C4D version is R19 and python version is 3.7,could anyone tell me how to solve this?

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @zhhm156,

        First of all, I would like to remind you to please use the Q&A functionality and also make proper usage of Tagging system.
        I let you set up your first post correctly.

        With that's said, there is currently no installation needed for the c4d python SDK. It's already embedded within Cinema4D and you can only access the c4d python module within c4d.
        Now with the R20 version and only R20 and more, we introduce a new executable called c4dpy which allow you to get the autocompletion, and doing some debugging within Pycharm. Unfortunately, it's not working for prior version.
        What you can do is use a Fake module for the autocompletion. Note this is made by the community (David Weidemann) and we don't provide support for it.

        Finally, c4d use a python version of 2.7x.

        To know the current python version you can write in the C4D python console.

        import sys
        print sys.version
        

        But as I know, in PyCharm you have to define an executable, even if you will not be able to run directly your code through PyCharm.
        You can find the python executable for versions prior to R20 in {C4D Install Path}/resource/modules/python/Python.win64.framework/python.exe

        If you have any question left, please let me know.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        Z 1 Reply Last reply Reply Quote 1
        • Z
          zhhm156
          last edited by

          Thanks firstly,you have made perfect answer i need, And i will keep your reminding about usage of QA functionationlty correctly in my mind.As your suggestion, i wonder if i tranfer my project from R19 to R20,are there some sources needed to change because of Compatibility? (PS: my project is made up of C++codes with a little bit of python)

          1 Reply Last reply Reply Quote 0
          • Z
            zhhm156 @m_adam
            last edited by

            @m_adam I have read maxon offical API Transition about R20 just before, And it made me a little bit astonished,which there are many changes in API between R20 and R19. It really puts my thought off even if i would like to use c4dpy as my python interpreter (╯ ̄Д ̄)╯

            1 Reply Last reply Reply Quote 0
            • M
              m_adam
              last edited by

              Hi, @zhhm156 you can see the list of python changes from R19 to R20 in this page, but pretty much all pythons scripts can be transferred from R19 to R20 without any change needed.
              For C++ there is more work needed, but you can search in the forum with the correct tag(it's why tagging is important, so please make use of them) or even in the SDK directly.

              If you have any questions regarding the migration, please open a new topic.

              Then finally here is how to setup c4dpy in pycharm for an R20 project.
              Cheers,
              Maxime.

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 0
              • M
                m_adam
                last edited by m_adam

                Hi @zhhm156

                I'm wondering if your question has been answered. If so, please mark this thread as solved.

                Cheers,
                Maxime.

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

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