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

    Issue with Python MultiProcessing in 24

    Cinema 4D SDK
    3
    3
    529
    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.
    • C
      conductor
      last edited by m_adam

      Hi,

      There seems t be a conflict between Python multiprocessing and Cinema 4D S24.

      If I enter into the console:

      import multiprocessing
      MYVAR = multiprocessing.Array("c", 2000)
      

      then a new instance of Cinema 4D is launched.

      This means that if I have the above line in a plugin, new instances of Cinema 4D are launched recursively.

      This behavior is not present in Cinema 4D versions before S24. Perhaps it's a Python3.9 issue.

      C4D Release S24
      Operating System Apple MacOS > OS X 11
      Operating System Version # 11.4

      Looking forward to your thoughts..

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

        Hi @conductor, welcome in plugincafe 🙂

        Unfortually I don't see a way to fix that. Cinema 4D is the Python Interpreter, and multiprocessing is designed to execute several instance of the current Python interpreter.

        Maya and Blender have the exact same behavior than Cinema 4D.

        You can somehow do it by overriding sys.executable and __file__ as explained here, but you will not be able to use any Cinema 4D API call within this MP.
        Moreover it may break some other functionality so I would recommend restoring them as their default value at the end of the execution of your MP thing 🙂

        Hope it helps,
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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

          Hello @conductor,

          without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly.

          Thank you for your understanding,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

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