Is there a way to have a preview of the rendered image during the render process (like the one you get after you press the render button) if the render process is started from a script with
bpy.ops.render.render()
?
Is there a way to have a preview of the rendered image during the render process (like the one you get after you press the render button) if the render process is started from a script with
bpy.ops.render.render()
?
If you call the render() operator via PyConsole or Text Editor, a different default execution context is used. It is 'EXEC_DEFAULT'.
In contrast, buttons in panels and also menu entries use 'INVOKE_DEFAULT' by default for operators.
You can override the execution context in layouts:
col = layout.column()
col.operator_context = 'EXEC_DEFAULT'
col.operator("render.render")
As well as in the console / editor:
bpy.ops.render.render('INVOKE_DEFAULT')
If you use an override and keyword arguments for an operator call, the order is:
bpy.ops.render.render({'dict': "override"}, # dictionary for context overriding
'EXECUTION_CONTEXT', # a valid execution context
undo, # undo support (True or False)
keyword="argument_1", # first operator argument
...) # more operator arguments follow here
Links: