Get/Set Preferences Item

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2011 at 20:39, xxxxxxxx wrote:

Hello all,

Is it possible to get/set the value of an item in the C4D Preferences dialog?
I've been trying several things but haven't had success.

Thanks in advance for the help!

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/03/2011 at 23:32, xxxxxxxx wrote:

I know it's possible for the OpenGL settings but maybe not for all of the prefs items.

Try dragging a prefs dialog entry (the label of a checkbox, the label before a combo box etc.) to the Python console it should give you the name of the description ID.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 24/03/2011 at 08:34, xxxxxxxx wrote:

Thanks for the reply!

I did manage to grab the settings from c4d.GetWorldContainer()
This seems to give me the items I need in a basecontainter however,
I can't tell what ID corresponds to what item in the preferences dialog.

When I drag the item to the console, the ID I get is very different from what
the c4d.GetWorldContainer() gives me. The only ID I can match up is the Port
item under Communication. I am able to set/get mainly because the number 8080
is easy to pick out.

Not sure if I'm going about it the right way.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 24/03/2011 at 14:05, xxxxxxxx wrote:

If you are looking for ways to find IDs, additionally to the mentioned drag & drop support you can do the following:

in the Python console line, enter

import c4d; print dir(c4d)

then inspect the output.

Since all symbols are now part of the main c4d module the dir() python function will show them all to you.
And I mean all, including IDs defined in Plugins and other (CINEMA 4D) modules.

And then theres the API search method:

There are some some header files included with the CINEMA 4D C++ SDK that give you direct insight into additional symbol names. These were mostly relevant for COFFEE and C++ put Python SDK being coded on top of the COFFEE API you can directly relate to the symbol names in Python.

In your MAXON/CINEMA 4D R12/resource folder, take a look at the files coffeesymbols.h and c4d_symbols.h. Also in that folder take a look around the sub folder modules/modeling/res/description, thats where the header files with symbols for modeling tools for example are stored. And you can also take a peek at other module folders. Just don't relocate, remove or change anything.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 24/03/2011 at 17:18, xxxxxxxx wrote:

@990adjustments: I also recommend you the C++ documentation which contains several additional information for such specific questions.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 24/03/2011 at 22:19, xxxxxxxx wrote:

Thank you gentlemen for the help and tips! Truly appreciate it!
Got what I needed working.

I had previously gone through the header files and thought I had found the correct IDs but having gone through them again I found the right ones.

Now my last question and this is were I was getting confused. When dragging an item from the prefs window, the description ID I was getting was different then the one that is actually required.

For instance if you drag port item from the communication section you get PREF_INTERNET_UPDATEPORT. The ID in the header file says 1002. Trying to set the value was not working. What I actually needed was WPREF_ONLINEUPDATER_PROXYPORT which has an ID of 40009. This gave me the desired results. Am I misunderstanding this?

Thanks AndreB, examining the output from dir() helped me locate the correct description.

Once again, thank you for the input. Thank you s_rath, I will definitely dig a little deeper into the C++ docs.