[Bf-blender-cvs] [87340fac277] soc-2020-info-editor: Expose debug_value in preferences
Mateusz GrzeliÅski
noreply at git.blender.org
Thu Jul 30 15:19:14 CEST 2020
Commit: 87340fac277ba5cdaff361d2d4365ecfa0d5e68b
Author: Mateusz Grzeliński
Date: Thu Jul 30 14:23:51 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB87340fac277ba5cdaff361d2d4365ecfa0d5e68b
Expose debug_value in preferences
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 28d148525a4..e51db930efe 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -645,7 +645,7 @@ class USERPREF_PT_system_video_sequencer(SystemPanel, CenterAlignMixIn, Panel):
class USERPREF_PT_system_logging(SystemPanel, CenterAlignMixIn, Panel):
- bl_label = "Logging"
+ bl_label = "Log & Debug"
def draw_centered(self, context, layout):
prefs = context.preferences
@@ -664,6 +664,7 @@ class USERPREF_PT_system_logging(SystemPanel, CenterAlignMixIn, Panel):
col = layout.column()
col.active = not system.log_use_stdout
col.prop(system, "log_output_file")
+ layout.prop(system, "debug_value")
layout.prop(system, "debug")
# -----------------------------------------------------------------------------
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 1a265a68251..f68ad2da46f 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1164,9 +1164,18 @@ static int rna_debug_get(PointerRNA *UNUSED(ptr))
static void rna_debug_set(PointerRNA *UNUSED(ptr), int value)
{
- printf("%d\n", value);
G.debug = value;
}
+
+static int rna_debug_value_get(PointerRNA *UNUSED(ptr))
+{
+ return G.debug_value;
+}
+
+static void rna_debug_value_set(PointerRNA *UNUSED(ptr), int value)
+{
+ G.debug_value = value;
+}
#else
# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
@@ -5754,10 +5763,13 @@ static void rna_def_userdef_system(BlenderRNA *brna)
"rna_clog_log_output_file_get",
"rna_clog_log_output_file_length",
"rna_clog_log_output_file_set");
+ RNA_def_property_ui_text(prop, "Log Output File", "");
+
prop = RNA_def_property(srna, "verbose", PROP_INT, PROP_NONE);
RNA_def_property_int_funcs(prop, "rna_verbose_get", "rna_verbose_set", NULL);
RNA_def_property_ui_text(prop, "Verbosity Level", "Verbosity for libraries that support it");
+ /* TODO (grzelins) now we can start removing bpy.app.debug */
static const EnumPropertyItem debug_items[] = {
{G_DEBUG, "DEBUG", ICON_NONE, "Debug", ""},
{G_DEBUG_FFMPEG, "DEBUG_FFMPEG", ICON_NONE, "Debug FFMPEG", ""},
@@ -5805,6 +5817,11 @@ static void rna_def_userdef_system(BlenderRNA *brna)
prop,
"Debug Flags",
"Boolean, for debug info (started with --debug / --debug_* matching this attribute name");
+
+ /* TODO (grzelins) now we can remove WM_OT_debug_menu */
+ prop = RNA_def_property(srna, "debug_value", PROP_INT, PROP_NONE);
+ RNA_def_property_int_funcs(prop, "rna_debug_value_get", "rna_debug_value_set", NULL);
+ RNA_def_property_ui_text(prop, "Debug Value", "Only developers know what is does");
}
static void rna_def_userdef_input(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list