diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-04-02 23:38:20 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-04-02 23:38:20 +0400 |
commit | 9a027080df135ade5d2237ffff299a0b1762910d (patch) | |
tree | 125cd65c3f4b45efc5a89fb2297e7d482e200618 /source/blender | |
parent | ea5936db0c199676ff0df019e83cabce50af9511 (diff) |
RNA Property debug in Main, mapped to G.f's G_DEBUG
Diffstat (limited to 'source/blender')
-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); |