Hello,
I am writing a python script that does various functions when appended a .blend file that is opening via command prompt. I’m having difficulty, though, with something that seems like it should be fairly obvious. I want to set the screen, upon the file opening, to be the 3D View only, so that when rendering begins, the only thing you will see is the UV/Image Editor rendering out the current file.
This generally works…
import bpy
for window in bpy.context.window_manager.windows:
screen = window.screen
for area in screen.areas:
if area.type == 'VIEW_3D':
override = {'window': window, 'screen': screen, 'area': area}
bpy.ops.screen.screen_full_area(override)
break
But not when I append it to a .blend file and run it with the command line --python function.
I have a sneaking suspicion that when blender loads, it does not have the context set when the script is firing, and therefore crashes blender.
Any suggestions?