Setting Preferences via script
-
Hey everyone,
I’m trying to roll out a few default preference settings across all company workstations, but I can’t find any solid reference or example on how to do it properly through Python.
Basically, I’d like to change things like:
- some Memory settings (Picture Viewer cache, etc.)
- a few File options (Autosave paths and intervals)
- certain Redshift preferences
- and enable the Verify Script check
My goal is to make sure every workstation starts with the same defaults, ideally via a startup script or a deployed config.
Unfortunately, I haven’t found any working example in the documentation or SDK that shows how to access and write these preferences in C4D 2025 / 2026
Does anyone have a current example or best practice for setting preferences programmatically in recent C4D versions?
Thanks a lot!
— Tobias -
After digging through some older threads and testing things, I found that this approach works — based on the discussion here:
https://developers.maxon.net/forum/topic/13555/python-how-to-get-axis-scale-from-the-preference-settings/2import c4d doc: c4d.documents.BaseDocument # The currently active document. op: c4d.BaseObject | None # The primary selected object in `doc`. Can be `None`. def main() -> None: # get preferences pref = c4d.plugins.FindPlugin(465001632) # Memory ((465001628, 1, 465001632), (888, 133, 465001632)) desc = c4d.DescID( c4d.DescLevel(465001628, 1, 465001632), c4d.DescLevel(888, 133, 465001632) ) memoryPref = pref[desc] memoryPref[c4d.PREF_MEMORY_PVHARDFOLDER] = "c:\\blubb" c4d.EventAdd() if __name__ == '__main__': main()
To discover all available IDs inside a preference node, you can list them like this:
for bc, descid, _ in pref.GetDescription(0): name = bc[c4d.DESC_NAME] print(name,descid)
So this topic is solved
-
Hey @pyr,
yes, that your own answer is correct, thank you for sharing it! But since
2026.0.0
there exist better ways to discover symbols and container values. Have a look at themxutils
change notes for 2026.0 for an overview.With g_c4d_symbol_translation_cache you can discover the symbol for a plugin ID such as
465001632
and with GetParameterTreeString you can inspect node parameters in a human readable form.Cheers,
Ferdinand