Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] General Discussion => Topic started by: htcg on 2025-06-20, 09:54:46

Title: How to get Corona version with Python?
Post by: htcg on 2025-06-20, 09:54:46
How to get Corona version with Python?
Title: Re: How to get Corona version with Python?
Post by: maru on 2025-06-20, 13:57:02
I am primarily a 3ds Max user so I don't know anything about Python in C4D, but I asked ChatGPT and it looks like it gave me a working code.
Just copy-paste into the Script Manager, hit Execute, and check your Console (Shift+F10 by default) for the printed Corona version:

Code: [Select]
import c4d

def main():
    # The “world” container holds all of C4D’s global settings.
    world = c4d.GetWorldContainerInstance()
    # Corona’s prefs are stored in a sub‐container under ID 1030480
    coronaPrefs = world[1030480]
    # Read the core version preference
    version = coronaPrefs[c4d.PREF_CORONA_CORE_VERSION]
    # Print it to the Console
    print(f"Corona for Cinema 4D version: {version}")

if __name__ == "__main__":
    main()

Looks like it used the information from https://forum.corona-renderer.com/index.php?topic=37328.0
Title: Re: How to get Corona version with Python?
Post by: htcg on 2025-06-20, 14:24:27
Thanks, this is exactly what I wanted