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

    Python Generator use a script

    Cinema 4D SDK
    python 2023
    2
    3
    434
    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.
    • K
      kverhaar
      last edited by

      I have some python generators which all use a script in the {C4D_SCRIPTS_DIR} folder. But somehow with updating this morning, this doesn't work any more. The File that is used is PyHuisStand and I use the following rule to import this:

      import PyHuisStand as HS

      What do I do wrong?

      Regards
      Kris

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

        Hi @kverhaar I think you confuse the two environment variable C4D_SCRIPTS_DIR and C4DPYTHONPATH3XX.

        C4D_SCRIPTS_DIR is used by the script manager to know which script can be loaded in the script manager (in its dropdown)
        C4DPYTHONPATH3XX is used to extend the sys.path of python, so you can import others scripts in your script via with the usual python command import {FileName}

        The last environment variable C4DPYTHONPATH3XX is always bound to the python version shipped with Cinema 4D to ensure compatibility. With that said in the latest updated as said in the Python SDK Documentation - What is New we updated Python from 3.9.1 to 3.10.8. Therefor the environment variable used by Cinema 4D 2023.2 is not anymore C4DPYTHONPATH39 but C4DPYTHONPATH310.

        So long story short, updating the environment variable name to C4DPYTHONPATH310 should fix your issue.
        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • K
          kverhaar
          last edited by

          Thanks 🙂

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