Skip to content

Commit

Permalink
Show the AI result image in an image editor even if the render result…
Browse files Browse the repository at this point in the history
… window is closed
  • Loading branch information
benrugg committed Oct 28, 2023
1 parent 43f4990 commit 2442475
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,17 @@ def get_areas_by_type(area_type, scene=None, context=None):
def find_area_showing_render_result(scene=None, context=None):
areas = get_areas_by_type('IMAGE_EDITOR', scene, context)

potential_area = None

for area in areas:
active_image = area.spaces.active.image
if active_image is not None and active_image.type == 'RENDER_RESULT':
return area
return None
if active_image is not None:
if active_image.type == 'RENDER_RESULT':
return area
else:
potential_area = area

return potential_area


def split_area(context, area, direction='HORIZONTAL', factor=0.5):
Expand Down

0 comments on commit 2442475

Please sign in to comment.