0
$\begingroup$

The result of a print("message") command called inside an operator appears immediately in the System Console.

However the result of self.report({'INFO'}, "message") called inside an operator's method, appears in the INFO window only after the operator finished its job. The same applies to bpy.ops.console.scrollback_append(text="message") used to print something in the Python Console

Is there a trick to force messages produced by self.report({'INFO'}, "message") and/or bpy.ops.console.scrollback_append(text="message") also to appear immediately?

$\endgroup$
  • $\begingroup$ check this hack if that works for you: blender.stackexchange.com/a/28689/7777. If not you will have to use a modal operator. $\endgroup$ – Jaroslav Jerryno Novotny Apr 12 '18 at 15:33
  • $\begingroup$ @JaroslavJerrynoNovotny I tried bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1). It partially helped for bpy.ops.console.scrollback_append(text="message"). The first messages appear immediately. But the rest of the messages appears after the operator finished its job. $\endgroup$ – vvoovv Apr 12 '18 at 18:28
  • $\begingroup$ the issue is that the operator is not designed for interactivity, the above I posted is a hack and may not always work. While the operator executes, Blender's UI does not redraw, scene does not update, etc.. The best is to use modal operator or even app.handlers if you want interactivity in your script, that is the clean approach. $\endgroup$ – Jaroslav Jerryno Novotny Apr 12 '18 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.