Commit: 6e301808957ac9da6d09bc7702814c36018285a1
Author: Mateusz Grzeliński
Date: Mon Aug 3 10:38:40 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB6e301808957ac9da6d09bc7702814c36018285a1
Convert printf to clog
===================================================================
M source/blender/blenkernel/BKE_subdiv_ccg.h
M source/blender/blenkernel/intern/cloth.c
M source/blender/blenkernel/intern/lib_override.c
M source/blender/blenkernel/intern/mask.c
M source/blender/blenkernel/intern/mask_evaluate.c
M source/blender/blenkernel/intern/mask_rasterize.c
M source/blender/blenkernel/intern/mesh_evaluate.c
M source/blender/blenkernel/intern/nla.c
M source/blender/blenkernel/intern/node.c
M source/blender/blenkernel/intern/object.c
M source/blender/blenkernel/intern/object_update.c
M source/blender/blenkernel/intern/ocean.c
M source/blender/blenkernel/intern/particle.c
M source/blender/blenkernel/intern/particle_distribute.c
M source/blender/blenkernel/intern/pbvh_bmesh.c
M source/blender/blenkernel/intern/sequencer.c
M source/blender/blenkernel/intern/softbody.c
M source/blender/blenkernel/intern/tracking_solver.c
M source/blender/blenkernel/intern/writeavi.c
M source/blender/blenkernel/intern/writeffmpeg.c
M source/blender/modifiers/intern/MOD_weightvgproximity.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_subdiv_ccg.h
b/source/blender/blenkernel/BKE_subdiv_ccg.h
index 5808f223f32..4a088a0f0d6 100644
--- a/source/blender/blenkernel/BKE_subdiv_ccg.h
+++ b/source/blender/blenkernel/BKE_subdiv_ccg.h
@@ -283,6 +283,14 @@ typedef struct SubdivCCGNeighbors {
SubdivCCGCoord coords_fixed[256];
} SubdivCCGNeighbors;
+/** healthy alternative to BKE_subdiv_ccg_print_coord */
+#define CLOG_VERBOSE_SUBDIV_CCG_COORD(log_ref, level, coord) /* const
SubdivCCGCoord *coord */\
+ CLOG_VERBOSE(log_ref, \
+ level, \
+ "grid index: %d, coord: (%d, %d)\n", \
+ coord->grid_index, \
+ coord->x, \
+ coord->y)
void BKE_subdiv_ccg_print_coord(const char *message, const SubdivCCGCoord
*coord);
bool BKE_subdiv_ccg_check_coord_valid(const SubdivCCG *subdiv_ccg, const
SubdivCCGCoord *coord);
diff --git a/source/blender/blenkernel/intern/cloth.c
b/source/blender/blenkernel/intern/cloth.c
index b0c0fcd9869..f55886b3dbb 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -413,8 +413,6 @@ static int do_step_cloth(
BKE_effectors_free(effectors);
- // printf ( "%f\n", ( float ) tval() );
-
return ret;
}
diff --git a/source/blender/blenkernel/intern/lib_override.c
b/source/blender/blenkernel/intern/lib_override.c
index 2989c910c45..d415da3e940 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
+#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "DNA_ID.h"
@@ -63,6 +64,8 @@
# include "PIL_time_utildefines.h"
#endif
+static CLG_LogRef LOG = {"bke.lib_override"};
+
static void lib_override_library_property_copy(IDOverrideLibraryProperty
*op_dst,
IDOverrideLibraryProperty
*op_src);
static void lib_override_library_property_operation_copy(
@@ -1104,17 +1107,15 @@ bool BKE_lib_override_library_operations_create(Main
*bmain, ID *local)
if (report_flags & RNA_OVERRIDE_MATCH_RESULT_CREATED) {
ret = true;
}
-#ifndef NDEBUG
if (report_flags & RNA_OVERRIDE_MATCH_RESULT_RESTORED) {
- printf("We did restore some properties of %s from its reference.\n",
local->name);
+ CLOG_DEBUG(&LOG, 0, "We did restore some properties of %s from its
reference", local->name);
}
if (ret) {
- printf("We did generate library override rules for %s\n", local->name);
+ CLOG_DEBUG(&LOG, 0, "We did generate library override rules for %s",
local->name);
}
else {
- printf("No new library override rules for %s\n", local->name);
+ CLOG_DEBUG(&LOG, 0, "No new library override rules for %s", local->name);
}
-#endif
}
return ret;
}
diff --git a/source/blender/blenkernel/intern/mask.c
b/source/blender/blenkernel/intern/mask.c
index 7e859799a4e..2159bf483b9 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1448,10 +1448,10 @@ void BKE_mask_layer_calc_handles(MaskLayer *masklay)
void BKE_mask_spline_ensure_deform(MaskSpline *spline)
{
int allocated_points = (MEM_allocN_len(spline->points_deform) /
sizeof(*spline->points_deform));
- // printf("SPLINE ALLOC %p %d\n", spline->points_deform, allocated_points);
+ CLOG_DEBUG(&LOG, 0, "SPLINE ALLOC %p %d", spline->points_deform,
allocated_points);
if (spline->points_deform == NULL || allocated_points != spline->tot_point) {
- // printf("alloc new deform spline\n");
+ CLOG_DEBUG(&LOG, 1, "alloc new deform spline");
if (spline->points_deform) {
int i;
@@ -1468,7 +1468,7 @@ void BKE_mask_spline_ensure_deform(MaskSpline *spline)
__func__);
}
else {
- // printf("alloc spline done\n");
+ CLOG_DEBUG(&LOG, 0, "alloc spline done");
}
}
diff --git a/source/blender/blenkernel/intern/mask_evaluate.c
b/source/blender/blenkernel/intern/mask_evaluate.c
index 9b281103a0f..036b674ddb7 100644
--- a/source/blender/blenkernel/intern/mask_evaluate.c
+++ b/source/blender/blenkernel/intern/mask_evaluate.c
@@ -23,6 +23,8 @@
* Functions for evaluating the mask beziers into points for the outline and
feather.
*/
+#include <BLI_blenlib.h>
+#include <CLG_log.h>
#include <stddef.h>
#include <string.h>
@@ -40,6 +42,8 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
+static CLG_LogRef LOG = {"bke.mask_evaluate"};
+
unsigned int BKE_mask_spline_resolution(MaskSpline *spline, int width, int
height)
{
float max_segment = 0.01f;
@@ -881,25 +885,23 @@ void BKE_mask_layer_evaluate_animation(MaskLayer
*masklay, const float ctime)
if ((found = BKE_mask_layer_shape_find_frame_range(
masklay, ctime, &masklay_shape_a, &masklay_shape_b))) {
if (found == 1) {
-#if 0
- printf("%s: exact %d %d (%d)\n",
- __func__,
- (int)ctime,
- BLI_listbase_count(&masklay->splines_shapes),
- masklay_shape_a->frame);
-#endif
+ CLOG_DEBUG(&LOG,
+ 5,
+ "exact %d %d (%d)",
+ (int)ctime,
+ BLI_listbase_count(&masklay->splines_shapes),
+ masklay_shape_a->frame);
BKE_mask_layer_shape_to_mask(masklay, masklay_shape_a);
}
else if (found == 2) {
float w = masklay_shape_b->frame - masklay_shape_a->frame;
-#if 0
- printf("%s: tween %d %d (%d %d)\n",
- __func__,
- (int)ctime,
- BLI_listbase_count(&masklay->splines_shapes),
- masklay_shape_a->frame,
- masklay_shape_b->frame);
-#endif
+ CLOG_DEBUG(&LOG,
+ 5,
+ "tween %d %d (%d %d)",
+ (int)ctime,
+ BLI_listbase_count(&masklay->splines_shapes),
+ masklay_shape_a->frame,
+ masklay_shape_b->frame);
BKE_mask_layer_shape_to_mask_interp(
masklay, masklay_shape_a, masklay_shape_b, (ctime -
masklay_shape_a->frame) / w);
}
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c
b/source/blender/blenkernel/intern/mask_rasterize.c
index 01d44d070b3..358c15b1af9 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -361,7 +361,7 @@ static bool layer_bucket_isect_test(const MaskRasterLayer
*layer,
return true;
}
else {
- // printf("skip tri\n");
+ CLOG_DEBUG(&LOG, 0, "skip tri");
return false;
}
}
@@ -386,7 +386,7 @@ static bool layer_bucket_isect_test(const MaskRasterLayer
*layer,
return true;
}
else {
- // printf("skip quad\n");
+ CLOG_DEBUG(&LOG, 0, "skip quad");
return false;
}
}
@@ -420,7 +420,7 @@ static void layer_bucket_init(MaskRasterLayer *layer, const
float pixel_size)
layer->buckets_x = (unsigned int)((bucket_dim_x / pixel_size) /
(float)BUCKET_PIXELS_PER_CELL);
layer->buckets_y = (unsigned int)((bucket_dim_y / pixel_size) /
(float)BUCKET_PIXELS_PER_CELL);
- // printf("bucket size %ux%u\n", layer->buckets_x, layer->buckets_y);
+ CLOG_DEBUG(&LOG, 1, "bucket size %ux%u", layer->buckets_x, layer->buckets_y);
CLAMP(layer->buckets_x, 8, 512);
CLAMP(layer->buckets_y, 8, 512);
@@ -1172,15 +1172,14 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle
*mr_handle,
MEM_freeN(open_spline_ranges);
-#if 0
- fprintf(stderr,
- "%u %u (%u %u), %u\n",
- face_index,
- sf_tri_tot + tot_feather_quads,
- sf_tri_tot,
- tot_feather_quads,
- tot_boundary_used - tot_boundary_found);
-#endif
+ CLOG_DEBUG(&LOG,
+ 2,
+ "%u %u (%u %u), %u",
+ face_index,
+ sf_tri_tot + tot_feather_quads,
+ sf_tri_tot,
+ tot_feather_quads,
+ tot_boundary_used - tot_boundary_found);
#ifdef USE_SCANFILL_EDGE_WORKAROUND
BLI_assert(face_index + (tot_boundary_used - tot_boundary_found) ==
@@ -1220,7 +1219,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle
*mr_handle,
layer->falloff = masklay->falloff;
}
- /* printf("tris %d, feather tris %d\n", sf_tri_tot, tot_feather_quads);
*/
+ CLOG_DEBUG(&LOG, 2, "tris %ud, feather tris %ud", sf_tri_tot,
tot_feather_quads);
}
/* add trianges */
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c
b/source/blender/blenkernel/intern/mesh_evaluate.c
index 499fb312ffe..0a23854f4a9 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -1168,7 +1168,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon
*common_data, LoopSpli
}
}
- // printf("FAN: vert %d, start edge %d\n", mv_pivot_index, ml_curr->e);
+ CLOG_DEBUG(&LOG, 0, "FAN: vert %ud, start edge %ud", mv_pivot_index,
ml_curr->e);
while (true) {
const MEdge *me_curr = &medges[mlfan_curr->e];
@@ -1185,7 +1185,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon
*common_data, LoopSpli
normalize_v3(vec_curr);
}
- // printf("\thandling edge %d / loop %d\n", mlfan_curr->e,
mlfan_curr_index);
+ CLOG_DEBUG(&LOG, 0, "\thandling edge %ud / loop %d", mlfan_curr->e,
mlfan_curr_index);
{
/* Code similar to accumulate_vertex_normals_poly_v3. */
@@ -1227,7 +1227,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon
*common_data, LoopSpli
/* Current edge is sharp and we have finished with this fan of faces
around this vert,
* or this vert is smooth, and we have completed a full turn around it.
*/
- // printf("FAN: Finished!\n");
+ CLOG_DEBUG(&LOG, 0, "FAN: Finished!");
break;
}
@@ -1509,12 +1509,12 @@ static void loop_split_generator(TaskPool *pool,
LoopSplitTaskDataCommon *common
ml_curr_index,
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs