Show only rendered image

I am using python script to render the image. I only want to show the IMAGE_EDITOR area( I think the rendered image gets shown in IMAGE_EDITOR area). It should show only the rendered image.
So basically I am trying to do 2 things here

  • Render the image
  • Show only the area with the image.

I hope I am clear on this. I tried to render image by - for area in bpy.context.screen.areas: if area.type == ‘INFO’: override = bpy.context.copy() override[‘area’] = area bpy.ops.render.render(override, use_viewport=True) breakBut it doesnt work.

Ok, so I have changed tg\he display mode to ‘Window’, by

bpy.data.scenes[“Scene”].render.display_mode = ‘WINDOW’

So, my problem remains , as to how to render the image programmatically.

How about this:

import bpy

bpy.context.scene.render.display_mode = 'AREA'


bpy.ops.render.render('INVOKE_DEFAULT')


for area in bpy.context.screen.areas:
    if area.type == 'IMAGE_EDITOR':
        if area.spaces.active.image.name == "Render Result":
            ctx = bpy.context.copy()
            ctx['area'] = area
            ctx['region'] = area.regions[-1]
            bpy.ops.screen.screen_full_area(ctx)
            break

It will start rendering to image editor (an area will be temporarily changed to this space type) and that area is maximized.

There is a small usability flaw however: Escape key will switch the area type back, but not revert the area from maximized to previous screen layout. You need to the the back to previous button (or a key combo for that).

Hey, Thanks for this. I had already achieved a similar result by -

bpy.data.scenes[“Scene”].render.display_mode = ‘SCREEN’
for area in bpy.context.screen.areas:
if area.type == ‘INFO’:
override = bpy.context.copy()
override[‘area’] = area
bpy.ops.render.view_show(‘INVOKE_DEFAULT’)
bpy.ops.render.render(override, use_viewport=True)
break

However, I need just this area. Not the headers . How can I make them turn off?