diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-04 03:27:20 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-04 03:27:20 +0400 |
commit | ec78eb353f71341f84999f47a7222becaadb8598 (patch) | |
tree | 0ae6937bcd59f93e0cec512f7b902686cf210e22 /source/blender/freestyle/intern/stroke/Operators.cpp | |
parent | 699da2fb0d9012cef5e45cc1b547a01fd92dbc1c (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/stroke/Operators.cpp')
-rw-r--r-- | source/blender/freestyle/intern/stroke/Operators.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp index 15aff89db45..e35a811fcab 100644 --- a/source/blender/freestyle/intern/stroke/Operators.cpp +++ b/source/blender/freestyle/intern/stroke/Operators.cpp @@ -40,6 +40,8 @@ #include "Canvas.h" #include "Stroke.h" +#include "BKE_global.h" + LIB_STROKE_EXPORT Operators::I1DContainer Operators::_current_view_edges_set; LIB_STROKE_EXPORT Operators::I1DContainer Operators::_current_chains_set; LIB_STROKE_EXPORT Operators::I1DContainer *Operators::_current_set = NULL; @@ -728,7 +730,9 @@ static int __recursiveSplit(Chain *_curve, UnaryFunction0D<double>& func, UnaryP new_curve_a->push_vertex_back(&(*vit)); } if ((vit == vitend) || (vnext == vitend)) { - cout << "The split takes place in bad location" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "The split takes place in bad location" << endl; + } newChains.push_back(_curve); delete new_curve_a; delete new_curve_b; @@ -897,7 +901,9 @@ static int __recursiveSplit(Chain *_curve, UnaryFunction0D<double>& func, UnaryP new_curve_a->push_vertex_back(&(*vit)); } if ((vit == vitend) || (vnext == vitend)) { - cout << "The split takes place in bad location" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "The split takes place in bad location" << endl; + } newChains.push_back(_curve); delete new_curve_a; delete new_curve_b; @@ -1143,8 +1149,11 @@ static Stroke *createStroke(Interface1D& inter) } dir.normalize(); Vec2r offset(dir * len); - //cout << "#vert " << nvert << " len " << len << " reverse? " << reverse << endl; - +#if 0 + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "#vert " << nvert << " len " << len << " reverse? " << reverse << endl; + } +#endif // add the offset to the overlapping vertices StrokeVertex *sv; std::vector<Interface0D *>::iterator it = overlapping_vertices.begin(), @@ -1190,7 +1199,7 @@ static Stroke *createStroke(Interface1D& inter) ++v; ++vnext; } - if (warning) { + if (warning && G.debug & G_DEBUG_FREESTYLE) { printf("Warning: stroke contains singular points.\n"); } } |