How to add new bool options to Settings->System area

Hello, I’m trying to add some options to settings area, digging the code I found the file seems to be ran_userdef.c (blender/makesrna/intern/rna_userdef.c) but adding something like this to line 4319:

prop = RNA_def_property(srna, “use_save_texture”, PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, “uiflag”, USER_SAVE_TEXTURE);
RNA_def_property_ui_text(
prop, “Auto save Texture”, “Automatic save texture on .blend save”);

And adding the enum eUserPref_Flag number 28 (number 27 is marked as DIRTY) inside file DNA_userdef_types.h row 919:

…omissis…
USER_FLAG_UNUSED_27 = (1<<27)
USER_SAVE_TEXTURE = (1 << 28)
…omissis…

Running after compiling and checking the Settings->System area doesn’t display any new checkbox.

Could someone explain me if I’m working on wrong files or missing some other file? thanks

What you did so far adds this option to RNA and DNA and therefore also to the Python API, but in order to display it you also have to add it to the Python code that defines the user interface.

The relevant file will be somewhere in release/scripts/startup/bl_ui.

1 Like

Thank you, searching inside the visual studio project doesn’t display any reference to those files, I thought it was “complete” (I mean the VS project includes all the files) instead those files are outside it (I followed the compile on windows https://wiki.blender.org/wiki/Building_Blender/Windows)!