"invalid operator call" on view_show

Hello,

I’m trying my hand at Blender scripting with Python. I’ve used Python (and C++ and Java) extensively outside of Blender but this is the first time I’ve tried scripting Blender specifically.

My script is breaking at this line:

bpy.ops.render.view_show()

which should be a simple invocation of the view_show operator, as used by the F11 key.

The error given in the terminal is:

wm_operator_invoke: invalid operator call 'RENDER_OT_view_show'

Except for the terminal error, nothing happens.

In addition, calling this from the Blender Python Console gives the same error and returns {‘PASS_THROUGH’}.

I’ve read this page on the wiki but my operator isn’t created dynamically; it’s a standard class that extends (bpy.types.Operator).

My end goal is to get the scene to render (bpy.ops.render.render) without just freezing the GUI; it should bring up the Render Result pane like F12 does. What’s the best way to do this?

try:

bpy.ops.render.view_show(‘INVOKE_DEFAULT’)