Here's another little issue I can't solve by myself:
I wrote a little python script called by blender from terminal (or dos cmd) that renders a scene letting you see the tiles composing the image like it does from "inside Blender" hitting the f12 button.
Now, I would like to popup a window with no menus and with the render result fitted in it.
This is what I do from terminal:
blender /path/to/file.blend -p 200 200 640 480 -P /path/to/python/script
This is the content of the python script:
import bpy
bpy.data.screens['screen_name'].scene = bpy.data.scenes['scene_name']
bpy.context.window.screen = bpy.data.screens['screen_name']
bpy.context.screen.scene = bpy.data.scenes['scene_name']
bpy.data.scenes['scene_name'].cycles.samples = 40
bpy.data.scenes['scene_name'].render.resolution_percentage = 50
#this "for" breaks all the code
for area in bpy.context.screen.areas:
if area.type == 'IMAGE_EDITOR':
override = bpy.context.copy()
override['area'] = area
bpy.ops.screen.screen_full_area(override, use_hide_panels=True)
bpy.ops.image.view_all(override, fit_view=False)
break
#what under work as intended without the "for"
bpy.ops.render.view_show('INVOKE_DEFAULT')
#renderizza
bpy.ops.render.render('INVOKE_DEFAULT', animation=False, write_still=True, use_viewport=False, scene='scene_name')
As I wrote in the comment in the py code, everything works just fine without the "for" code. The error I got on Ubuntu is
RuntimeError: Operator bpy.ops.image.view_all.poll() failed, context is incorrect
On windows it adds a EXCEPTION_ACCESS_VIOLATION (windows always have to make some sort of drama :-)
What did I do wrong?
Thank you for your time and for you help.