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/Stroke.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/Stroke.cpp')
-rw-r--r-- | source/blender/freestyle/intern/stroke/Stroke.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp index 477092f2e7a..96e3b7aac48 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.cpp +++ b/source/blender/freestyle/intern/stroke/Stroke.cpp @@ -37,6 +37,8 @@ #include "StrokeIterators.h" #include "StrokeRenderer.h" +#include "BKE_global.h" + /**********************************/ /* */ /* */ @@ -208,12 +210,16 @@ StrokeAttribute& StrokeAttribute::operator=(const StrokeAttribute& iBrother) float StrokeAttribute::getAttributeReal(const char *iName) const { if (!_userAttributesReal) { - cout << "StrokeAttribute warning: no real attribute was defined" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no real attribute was defined" << endl; + } return 0.0f; } realMap::iterator a = _userAttributesReal->find(iName); if (a == _userAttributesReal->end()) { - cout << "StrokeAttribute warning: no real attribute was added with the name " << iName << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no real attribute was added with the name " << iName << endl; + } return 0.0f; } return (*a).second; @@ -222,12 +228,16 @@ float StrokeAttribute::getAttributeReal(const char *iName) const Vec2f StrokeAttribute::getAttributeVec2f(const char *iName) const { if (!_userAttributesVec2f) { - cout << "StrokeAttribute warning: no Vec2f attribute was defined" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no Vec2f attribute was defined" << endl; + } return 0; } Vec2fMap::iterator a = _userAttributesVec2f->find(iName); if (a == _userAttributesVec2f->end()) { - cout << "StrokeAttribute warning: no Vec2f attribute was added with the name " << iName << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no Vec2f attribute was added with the name " << iName << endl; + } return 0; } return (*a).second; @@ -236,12 +246,16 @@ Vec2f StrokeAttribute::getAttributeVec2f(const char *iName) const Vec3f StrokeAttribute::getAttributeVec3f(const char *iName) const { if (!_userAttributesVec3f) { - cout << "StrokeAttribute warning: no Vec3f attribute was defined" << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no Vec3f attribute was defined" << endl; + } return 0; } Vec3fMap::iterator a = _userAttributesVec3f->find(iName); if (a == _userAttributesVec3f->end()) { - cout << "StrokeAttribute warning: no Vec3f attribute was added with the name " << iName << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "StrokeAttribute warning: no Vec3f attribute was added with the name " << iName << endl; + } return 0; } return (*a).second; |