Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-04 03:27:20 +0400
commitec78eb353f71341f84999f47a7222becaadb8598 (patch)
tree0ae6937bcd59f93e0cec512f7b902686cf210e22 /source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
parent699da2fb0d9012cef5e45cc1b547a01fd92dbc1c (diff)
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! :)
Diffstat (limited to 'source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp')
-rw-r--r--source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
index c7925026cd5..24cef37f381 100644
--- a/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
+++ b/source/blender/freestyle/intern/view_map/ArbitraryGridDensityProvider.cpp
@@ -34,6 +34,8 @@
#include "ArbitraryGridDensityProvider.h"
+#include "BKE_global.h"
+
ArbitraryGridDensityProvider::ArbitraryGridDensityProvider(OccluderSource& source, const real proscenium[4],
unsigned numCells)
: GridDensityProvider(source), numCells(numCells)
@@ -67,13 +69,17 @@ void ArbitraryGridDensityProvider::initialize(const real proscenium[4])
float prosceniumWidth = (proscenium[1] - proscenium[0]);
float prosceniumHeight = (proscenium[3] - proscenium[2]);
real cellArea = prosceniumWidth * prosceniumHeight / numCells;
- cout << prosceniumWidth << " x " << prosceniumHeight << " grid with cells of area " << cellArea << "." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << prosceniumWidth << " x " << prosceniumHeight << " grid with cells of area " << cellArea << "." << endl;
+ }
_cellSize = sqrt(cellArea);
// Now we know how many cells make each side of our grid
_cellsX = ceil(prosceniumWidth / _cellSize);
_cellsY = ceil(prosceniumHeight / _cellSize);
- cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ }
// Make sure the grid exceeds the proscenium by a small amount
float safetyZone = 0.1f;
@@ -83,7 +89,9 @@ void ArbitraryGridDensityProvider::initialize(const real proscenium[4])
if (_cellsY * _cellSize < prosceniumHeight * (1.0 + safetyZone)) {
_cellsY = prosceniumHeight * (1.0 + safetyZone) / _cellSize;
}
- cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ if (G.debug & G_DEBUG_FREESTYLE) {
+ cout << _cellsX << "x" << _cellsY << " cells of size " << _cellSize << " square." << endl;
+ }
// Find grid origin
_cellOrigin[0] = ((proscenium[0] + proscenium[1]) / 2.0) - (_cellsX / 2.0) * _cellSize;