diff options
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index e51bea20f27..7a680e00c8b 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -33,8 +33,23 @@ #include "BKE_main.h" #include "BKE_mesh.h" +#include "BKE_global.h" /* all the list begin functions are added manually here, Main is not in SDNA */ +static int rna_Main_debug_get(PointerRNA *ptr) +{ + return G.f & G_DEBUG; +} + + +static void rna_Main_debug_set(PointerRNA *ptr, const int value) +{ + if (value) + G.f |= G_DEBUG; + else + G.f &= ~G_DEBUG; +} + static void rna_Main_filename_get(PointerRNA *ptr, char *value) { @@ -294,6 +309,11 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file"); + prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Main_debug_get", "rna_Main_debug_set"); + RNA_def_property_ui_text(prop, "Debug", "Print debugging information in console"); + + for(i=0; lists[i].name; i++) { prop= RNA_def_property(srna, lists[i].identifier, PROP_COLLECTION, PROP_NONE); |