[Bf-blender-cvs] [5a5590c4899] soc-2020-info-editor: Add functions for logging arrays

Mateusz Grzeliński noreply at git.blender.org
Tue Aug 4 14:14:09 CEST 2020


Commit: 5a5590c489909218cc963641f6817d9375324a0a
Author: Mateusz Grzeliński
Date:   Tue Aug 4 09:02:24 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB5a5590c489909218cc963641f6817d9375324a0a

Add functions for logging arrays

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

M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/bmesh/intern/bmesh_mesh.c

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

diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 362ab3769a0..fd0284391d4 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -429,6 +429,34 @@ void print_v3(const char *str, const float a[3]);
 void print_v4(const char *str, const float a[4]);
 void print_vn(const char *str, const float v[], const int n);
 
+#define CLOG_V2(log_ref, log_level, str, v) \
+  { \
+    CLOG_VERBOSE(log_ref, log_level, "%s: %.8f %.8f", str, v[0], v[1]); \
+  } \
+  (void)0
+
+#define CLOG_V3(log_ref, log_level, str, v) \
+  { \
+    CLOG_VERBOSE(log_ref, log_level, "%s: %.8f %.8f %.8f", str, v[0], v[1], v[2]); \
+  } \
+  (void)0
+
+#define CLOG_V4(log_ref, log_level, str, v) \
+  { \
+    CLOG_VERBOSE(log_ref, log_level, "%s: %.8f %.8f %.8f %.8f", str, v[0], v[1], v[2], v[3]); \
+  } \
+  (void)0
+
+#define CLOG_VN(log_ref, log_level, str, v, n) \
+  { \
+    int i = 0; \
+    CLOG_VERBOSE(log_ref, log_level, "%s[%d]:", str, n); \
+    while (i < n) { \
+      CLOG_VERBOSE(log_ref, log_level, " %.8f", v[i++]); \
+    } \
+  } \
+  (void)0
+
 #define print_v2_id(v) print_v2(STRINGIFY(v), v)
 #define print_v3_id(v) print_v3(STRINGIFY(v), v)
 #define print_v4_id(v) print_v4(STRINGIFY(v), v)
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index ba90363ec3b..92729b3fd85 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -957,11 +957,11 @@ static void bm_mesh_loops_calc_normals(BMesh *bm,
                 /* printf("Invalid clnors in this fan!\n"); */
 
                 while ((clnor = BLI_SMALLSTACK_POP(clnors))) {
-                  // print_v2("org clnor", clnor);
+                  // CLOG_V2(&LOG, 3, "original clnor", clnor);
                   clnor[0] = (short)clnors_avg[0];
                   clnor[1] = (short)clnors_avg[1];
                 }
-                // print_v2("new clnors", clnors_avg);
+                // CLOG_V2(&LOG, 3, "new clnor", clnors_avg);
               }
               else {
                 /* We still have to consume the stack! */



More information about the Bf-blender-cvs mailing list