Logging: Use CLOG for blenkernel
[blender.git] / source / blender / blenkernel / intern / dynamicpaint.c
index 094f13d066c5b57cb90cd0096813deb4bb6167e0..a93ed7461c359054ae181e358b9b41e3068da256 100644 (file)
@@ -63,7 +63,6 @@
 #include "BKE_deform.h"
 #include "BKE_dynamicpaint.h"
 #include "BKE_effect.h"
-#include "BKE_global.h"
 #include "BKE_image.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 
 #include "atomic_ops.h"
 
+#include "CLG_log.h"
+
 /* could enable at some point but for now there are far too many conversions */
 #ifdef __GNUC__
 //#  pragma GCC diagnostic ignored "-Wdouble-promotion"
 #endif
 
+static CLG_LogRef LOG = {"bke.dynamicpaint"};
+
 /* precalculated gaussian factors for 5x super sampling */
 static const float gaussianFactors[5] = {
     0.996849f,
@@ -241,6 +244,7 @@ static int setError(DynamicPaintCanvasSettings *canvas, const char *string)
 {
        /* Add error to canvas ui info label */
        BLI_strncpy(canvas->error, string, sizeof(canvas->error));
+       CLOG_STR_ERROR(&LOG, string);
        return 0;
 }
 
@@ -2811,7 +2815,7 @@ int dynamicPaint_createUVSurface(Scene *scene, DynamicPaintSurface *surface, flo
        /*
         * Start generating the surface
         */
-       printf("DynamicPaint: Preparing UV surface of %ix%i pixels and %i tris.\n", w, h, tottri);
+       CLOG_INFO(&LOG, 1, "Preparing UV surface of %ix%i pixels and %i tris.", w, h, tottri);
 
        /* Init data struct */
        if (surface->data)
@@ -4449,7 +4453,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
                particlesAdded++;
        }
        if (invalidParticles)
-               printf("Warning: Invalid particle(s) found!\n");
+               CLOG_WARN(&LOG, "Invalid particle(s) found!");
 
        /* If no suitable particles were found, exit */
        if (particlesAdded < 1) {
@@ -5963,8 +5967,6 @@ static int dynamicPaint_doStep(
                                            psys_check_enabled(brushObj, brush->psys, for_render))
                                        {
                                                /* Paint a particle system */
-                                               BKE_animsys_evaluate_animdata(depsgraph, scene, &brush->psys->part->id, brush->psys->part->adt,
-                                                                             BKE_scene_frame_get(scene), ADT_RECALC_ANIM);
                                                dynamicPaint_paintParticles(surface, brush->psys, brush, timescale);
                                        }
                                        /* Object center distance: */