[Bf-blender-cvs] [cb9dadbd22f] soc-2020-info-editor: Revert removing RPT_DEBUG

Mateusz Grzeliński noreply at git.blender.org
Fri Jul 31 12:51:10 CEST 2020


Commit: cb9dadbd22f026ca509a36d39a1d6f3668d257ec
Author: Mateusz Grzeliński
Date:   Fri Jul 31 11:15:49 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rBcb9dadbd22f026ca509a36d39a1d6f3668d257ec

Revert removing RPT_DEBUG

===================================================================

M	release/scripts/startup/bl_ui/space_info.py
M	source/blender/blenkernel/intern/report.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/blenloader/intern/versioning_defaults.c
M	source/blender/editors/space_info/info_draw.c
M	source/blender/editors/space_info/info_report.c
M	source/blender/editors/space_info/space_info.c
M	source/blender/editors/transform/transform_convert_armature.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/makesrna/intern/rna_wm.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index c043637018d..9d6719f5b35 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -140,6 +140,7 @@ class INFO_PT_report_type_visibility(Panel):
 
         layout.label(text="Report Types Visibility")
         col = layout.column(align=True)
+        col.prop(sinfo, "show_report_debug", text="Debug")
         col.prop(sinfo, "show_report_info", text="Info")
         col.prop(sinfo, "show_report_operator", text="Operator")
         col.prop(sinfo, "show_report_warning", text="Warning")
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index db26c59594e..d235409c543 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -43,6 +43,8 @@ static CLG_LogRef LOG = {"bke.report"};
 const char *BKE_report_type_str(ReportType type)
 {
   switch (type) {
+    case RPT_DEBUG:
+      return TIP_("Debug");
     case RPT_INFO:
       return TIP_("Info");
     case RPT_OPERATOR:
@@ -67,6 +69,8 @@ const char *BKE_report_type_str(ReportType type)
 static enum CLG_Severity report_type_to_severity(ReportType type)
 {
   switch (type) {
+    case RPT_DEBUG:
+      return CLG_SEVERITY_VERBOSE;
     case RPT_INFO:
       return CLG_SEVERITY_INFO;
     case RPT_OPERATOR:
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c
index b4525a504c6..4ba9712462f 100644
--- a/source/blender/blenloader/intern/versioning_250.c
+++ b/source/blender/blenloader/intern/versioning_250.c
@@ -1859,7 +1859,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
             SpaceInfo *sinfo = (SpaceInfo *)sl;
             ARegion *region;
 
-            sinfo->report_mask_exclude = 0;
+            sinfo->report_mask_exclude = RPT_DEBUG_ALL;
 
             for (region = area->regionbase.first; region; region = region->next) {
               if (region->regiontype == RGN_TYPE_WINDOW) {
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index eb19a6a4334..8b5d5ac5b21 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -178,7 +178,7 @@ static void blo_update_defaults_screen(bScreen *screen,
     }
     else if (area->spacetype == SPACE_INFO) {
       SpaceInfo *sinfo = area->spacedata.first;
-      sinfo->report_mask_exclude = 0;
+      sinfo->report_mask_exclude = RPT_DEBUG_ALL;
     }
     else if (area->spacetype == SPACE_TEXT) {
       /* Show syntax and line numbers in Script workspace text editor. */
diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c
index 63b36895dca..7957e52ff32 100644
--- a/source/blender/editors/space_info/info_draw.c
+++ b/source/blender/editors/space_info/info_draw.c
@@ -109,6 +109,11 @@ static enum eTextViewContext_LineFlag report_line_draw_data(TextViewContext *tvc
     icon_bg_id = TH_INFO_INFO;
     *r_icon = ICON_INFO;
   }
+  else if (report->type & RPT_DEBUG_ALL) {
+    icon_fg_id = TH_INFO_DEBUG_TEXT;
+    icon_bg_id = TH_INFO_DEBUG;
+    *r_icon = ICON_SYSTEM;
+  }
   else if (report->type & RPT_PROPERTY) {
     icon_fg_id = TH_INFO_PROPERTY_TEXT;
     icon_bg_id = TH_INFO_PROPERTY;
diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c
index 2b65951956c..06894affa64 100644
--- a/source/blender/editors/space_info/info_report.c
+++ b/source/blender/editors/space_info/info_report.c
@@ -90,6 +90,9 @@ int info_report_mask(const SpaceInfo *sinfo)
 {
   int report_mask = 0;
 
+  if (!(sinfo->report_mask_exclude & INFO_RPT_DEBUG)) {
+    report_mask |= RPT_DEBUG_ALL;
+  }
   if (!(sinfo->report_mask_exclude & INFO_RPT_INFO)) {
     report_mask |= RPT_INFO_ALL;
   }
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 63e9f47a302..45379ae5782 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -64,7 +64,7 @@ static SpaceLink *info_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen
   sinfo = MEM_callocN(sizeof(SpaceInfo), "initinfo");
   sinfo->spacetype = SPACE_INFO;
 
-  sinfo->report_mask_exclude = 0;
+  sinfo->report_mask_exclude = RPT_DEBUG_ALL;
 
   /* header */
   region = MEM_callocN(sizeof(ARegion), "header for info");
diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c
index c0ad9a89826..9885c8fc3a6 100644
--- a/source/blender/editors/transform/transform_convert_armature.c
+++ b/source/blender/editors/transform/transform_convert_armature.c
@@ -844,8 +844,7 @@ void createTransPose(TransInfo *t)
     }
 
     if (td != (tc->data + tc->data_len)) {
-      // todo convert to log
-//      BKE_report(t->reports, RPT_DEBUG, "Bone selection count error");
+      BKE_report(t->reports, RPT_DEBUG, "Bone selection count error");
     }
   }
 
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 4826f2f045d..2b656011696 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -136,6 +136,7 @@ typedef enum eSpaceInfo_ClogShow {
 
 /* SpaceInfo.report_mask_exclude */
 typedef enum eSpaceInfo_RptMask {
+  INFO_RPT_DEBUG = (1 << 0),
   INFO_RPT_INFO = (1 << 1),
   INFO_RPT_OP = (1 << 2),
   INFO_RPT_WARN = (1 << 3),
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 6d5f03e01d0..3c266bb8a44 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -59,7 +59,7 @@ struct wmTimer;
 
 /* keep in sync with 'rna_enum_wm_report_items' in rna_wm.c */
 typedef enum ReportType {
-  /* RPT_DEBUG = (1 << 0), // unused, replaced with logs */
+  RPT_DEBUG = (1 << 0),
   RPT_INFO = (1 << 1),
   RPT_OPERATOR = (1 << 2),
   RPT_PROPERTY = (1 << 3),
@@ -70,7 +70,7 @@ typedef enum ReportType {
   RPT_ERROR_OUT_OF_MEMORY = (1 << 8),
 } ReportType;
 
-//#define RPT_DEBUG_ALL (RPT_DEBUG) // unused
+#define RPT_DEBUG_ALL (RPT_DEBUG)
 #define RPT_INFO_ALL (RPT_INFO)
 #define RPT_OPERATOR_ALL (RPT_OPERATOR)
 #define RPT_PROPERTY_ALL (RPT_PROPERTY)
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index f1805b7beb3..0a7fb5d3971 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -6005,6 +6005,12 @@ static void rna_def_space_info(BlenderRNA *brna)
   RNA_def_struct_ui_text(srna, "Space Info", "Info space data");
 
   /* reporting display */
+  prop = RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", INFO_RPT_DEBUG);
+  RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info");
+  RNA_def_property_ui_icon(prop, ICON_SYSTEM, 0);
+  RNA_def_property_update(prop, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
+
   prop = RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_negative_sdna(prop, NULL, "report_mask_exclude", INFO_RPT_INFO);
   RNA_def_property_ui_text(prop, "Show Info", "Display general information");
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 4cf0b1f044d..bfd99c01551 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -500,6 +500,7 @@ const EnumPropertyItem rna_enum_operator_property_tags[] = {
 
 /* flag/enum */
 const EnumPropertyItem rna_enum_wm_report_items[] = {
+    {RPT_DEBUG, "DEBUG", 0, "Debug", ""},
     {RPT_INFO, "INFO", 0, "Info", ""},
     {RPT_OPERATOR, "OPERATOR", 0, "Operator", ""},
     {RPT_PROPERTY, "PROPERTY", 0, "Property", ""},



More information about the Bf-blender-cvs mailing list