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! :) --- .../freestyle/intern/system/PythonInterpreter.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'source/blender/freestyle/intern/system') diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h index c6acf502e5e..6093b6e4dcd 100644 --- a/source/blender/freestyle/intern/system/PythonInterpreter.h +++ b/source/blender/freestyle/intern/system/PythonInterpreter.h @@ -103,9 +103,9 @@ public: #endif if (status != 1) { - cout << "\nError executing Python script from PythonInterpreter::interpretFile" << endl; - cout << "File: " << fn << endl; - cout << "Errors: " << endl; + cerr << "\nError executing Python script from PythonInterpreter::interpretFile" << endl; + cerr << "File: " << fn << endl; + cerr << "Errors: " << endl; BKE_reports_print(reports, RPT_ERROR); return 1; } @@ -124,9 +124,9 @@ public: BKE_reports_clear(reports); if (!BPY_text_exec(_context, text, reports, false)) { - cout << "\nError executing Python script from PythonInterpreter::interpretText" << endl; - cout << "Name: " << name << endl; - cout << "Errors: " << endl; + cerr << "\nError executing Python script from PythonInterpreter::interpretText" << endl; + cerr << "Name: " << name << endl; + cerr << "Errors: " << endl; BKE_reports_print(reports, RPT_ERROR); return 1; } @@ -173,9 +173,11 @@ private: for (vector::const_iterator it = pathnames.begin(); it != pathnames.end(); ++it) { if (!it->empty()) { - cout << "Adding Python path: " << *it << endl; + if (G.debug & G_DEBUG_FREESTYLE) { + cout << "Adding Python path: " << *it << endl; + } cmd = "sys.path.append(r\"" + *it + "\")\n"; - txt_insert_buf(text, const_cast(cmd.c_str())); + txt_insert_buf(text, const_cast(cmd.c_str())); } } -- cgit v1.2.3