From ec78eb353f71341f84999f47a7222becaadb8598 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 3 Jan 2013 23:27:20 +0000 Subject: New command-line option --debug-freestyle to enable verbose debug messages on the console during Freestyle rendering. The debug prints are turned off by default now. Errors are still printed on the console. A patch set implementing this functionality was provided by Bastien Montagne. Many thanks! :) --- source/blender/freestyle/intern/stroke/Canvas.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source/blender/freestyle/intern/stroke/Canvas.cpp') diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp index a51c138f64e..4427192a7b0 100644 --- a/source/blender/freestyle/intern/stroke/Canvas.cpp +++ b/source/blender/freestyle/intern/stroke/Canvas.cpp @@ -49,6 +49,8 @@ #include "../view_map/SteerableViewMap.h" +#include "BKE_global.h" + //soc #include //soc #include @@ -334,7 +336,7 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i QImage *qimg; QImage newMap(filePath.c_str()); if (newMap.isNull()) { - cout << "Could not load image file " << filePath << endl; + cerr << "Could not load image file " << filePath << endl; return; } qimg = &newMap; @@ -342,7 +344,7 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i /* OCIO_TODO: support different input color space */ ImBuf *qimg = IMB_loadiffname(filePath.c_str(), 0, NULL); if (qimg == 0) { - cout << "Could not load image file " << filePath << endl; + cerr << "Could not load image file " << filePath << endl; return; } @@ -455,12 +457,16 @@ void Canvas::loadMap(const char *iFileName, const char *iMapName, unsigned int i float Canvas::readMapPixel(const char *iMapName, int level, int x, int y) { if (_maps.empty()) { - cout << "readMapPixel warning: no map was loaded "<< endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "readMapPixel warning: no map was loaded "<< endl; + } return -1; } mapsMap::iterator m = _maps.find(iMapName); if (m == _maps.end()) { - cout << "readMapPixel warning: no map was loaded with the name " << iMapName << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "readMapPixel warning: no map was loaded with the name " << iMapName << endl; + } return -1; } ImagePyramid *pyramid = (*m).second; -- cgit v1.2.3