Author Topic: How to use python code in the corona .h files  (Read 983 times)

2022-07-01, 10:43:10

JPeters

  • Active Users
  • **
  • Posts: 87
    • View Profile
Hi there,

Got a quick question, in the plugin directory=>corona=>res=>description=> are a lot of .h files that contain useful synstaxes.

Let's say that from the "prefscorona.h" I'd want to use the synstax "PREF_CORONA_CORE_VERSION".

How do I actually write that in code in the script editor to use it?

c4d[PREF_CORONA_CORE_VERSION] doesn't work
c4d.[PREF_CORONA_CORE_VERSION] doesn't work
[PREF_CORONA_CORE_VERSION] doesn't work
etc.

Normally I would use these kinds of syntaxes on an actual object, so on for instance a corona light object to get the intensity.
But for the life of me I don't know on what kind of object to apply this syntax.....

Cheers,

2022-07-01, 12:56:24
Reply #1

Ales

  • Corona Team
  • Active Users
  • ****
  • Posts: 184
    • View Profile
Hi,

the data container storing all Corona preferences can be retrieved from main C4D settings container under ID 1030480 - this ID is currently not visible in the .h files in plugin folders, but we'll try adding it in the future so that you wouldn't need to hardcode its value.

An example for reading PREF_CORONA_CORE_VERSION you mentioned would be:

Code: [Select]
coronaPreferences = c4d.GetWorldContainerInstance()[1030480]
coronaPreferences[c4d.PREF_CORONA_CORE_VERSION]

2022-07-01, 17:11:55
Reply #2

JPeters

  • Active Users
  • **
  • Posts: 87
    • View Profile
Aaaaah, thanks a million!

Yeah it would be nice if it was clearer how to use some of these. As I said it's quite obvious with lights and materials but stuff like this is a bit more......technical....