[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27965] trunk/blender/source/blender/ makesrna/intern/rna_main.c: RNA Property debug in Main, mapped to G.f' s G_DEBUG

Martin Poirier theeth at yahoo.com
Fri Apr 2 21:38:20 CEST 2010


Revision: 27965
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27965
Author:   theeth
Date:     2010-04-02 21:38:20 +0200 (Fri, 02 Apr 2010)

Log Message:
-----------
RNA Property debug in Main, mapped to G.f's G_DEBUG

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_main.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_main.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_main.c	2010-04-02 18:16:24 UTC (rev 27964)
+++ trunk/blender/source/blender/makesrna/intern/rna_main.c	2010-04-02 19:38:20 UTC (rev 27965)
@@ -33,9 +33,24 @@
 
 #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)
 {
 	Main *bmain= (Main*)ptr->data;
@@ -294,6 +309,11 @@
 	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);





More information about the Bf-blender-cvs mailing list