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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Python 3.7.7 will be in the next release of Cinema 4D

    Cinema 4D SDK
    2
    6
    1.1k
    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.
    • ?
      A Former User
      last edited by A Former User

      For those who didn't see the announcement this morning, the next release of Cinema 4D is moving to Python 3.7.7
      CELEBRATING 10 YEARS OF PYTHON IN CINEMA 4D WITH A MAJOR MILESTONE

      3D Motion Show - Siggraph 2020 - Day 1 23-3 screenshot.png

      1 Reply Last reply Reply Quote 0
      • I
        iluxa7k
        last edited by

        Finally
        Will continue to port taichi to c4d

        1 Reply Last reply Reply Quote 0
        • ?
          A Former User
          last edited by A Former User

          "If developers have predominately used Cinema 4D's API the changes should be minor, and most changes can be made in a backwards-compatible way so there's no need to maintain a separate code base to continue supporting older Cinema 4D releases. In fact, the 2to3 tool included in every Python distribution makes it easy to identify compatibility issues and can directly patch your code."

          Will there be an example of how to do this in the SDK examples on GitHub?

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by

            60e6de04-49c8-4a16-b486-1c00d75146e1-image.png

            1 Reply Last reply Reply Quote 0
            • I
              iluxa7k
              last edited by iluxa7k

              I think users are having S22 now and will be R22 with py2.7. But showed S22.9XX build. So we will get R23 with python 3.7x but need 3.8(3.9) in the end of 2021

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User
                last edited by A Former User

                I have been looking at my plugins and my biggest question so far is how to handle urllib2 in a way that will work with both Python 2.7 and 3.7.7. Everything else just seems to be adding parentheses to print functions.

                I found this Cheat Sheet: Writing Python 2-3 compatible code that suggests:

                # Python 2 and 3: easiest option
                from future.standard_library import install_aliases
                install_aliases()
                
                from urllib.parse import urlparse, urlencode
                from urllib.request import urlopen, Request
                from urllib.error import HTTPError
                

                However, trying that in Cinema 4D threw this error:

                ImportError: No module named future.standard_library
                

                Fortunately, there are some alternatives to try, like

                # Python 2 and 3: alternative 4
                try:
                    from urllib.parse import urlparse, urlencode
                    from urllib.request import urlopen, Request
                    from urllib.error import HTTPError
                except ImportError:
                    from urlparse import urlparse
                    from urllib import urlencode
                    from urllib2 import urlopen, Request, HTTPError
                

                From that article: "urllib is the hardest module to use from Python 2/3 compatible code."

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