Changes to allow python to do redraws through the timer operator, a reliable way to test the overhead of the python api (printed to the consoel on exit).

- rename WM_OT_ten_timer to WM_OT_redraw_timer
- added iterations argument to run more then 10 times (10 is default still)
- use report api rather then always calling a popup directly.
- added a new test that draws every region without swapping.
- dont show the info popup when operators are called from python.
- operators called from python now print reports, useful with the interactive console.

 eg. 
>>> bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=300)
Info: 300 x Draw Window: 4168.56 ms,  average: 13.8952
This commit is contained in:
2009-09-22 09:12:39 +00:00
parent 3c8d34b94e
commit 92145d5950
5 changed files with 66 additions and 26 deletions

View File

@@ -89,6 +89,16 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
if(BPy_reports_to_error(reports))
error_val = -1;
/* operator output is nice to have in the terminal/console too */
if(reports->list.first) {
char *report_str= BKE_reports_string(reports, 0); /* all reports */
if(report_str) {
PySys_WriteStdout(report_str);
MEM_freeN(report_str);
}
}
BKE_reports_clear(reports);
if ((reports->flag & RPT_FREE) == 0)
{