Overriding context in Blender 4.*

Hi, I’m using quite a lot of context overriding like this:

override = {
  'window': window, 
  'screen': window.screen, 
  'area': window.screen.areas[0]
}
bpy.ops.screen.screen_full_area(override)

But in Blender 4.0 Beta and 4.1 Alpha it ends with this exception.

Wtf happened here? Is there any replacement? It’s quite a big paradigm shift in Python API I guess.

Ah, I see now. Sometimes I google for a long time and just seconds after asking I find the correct answer…

with bpy.context.temp_override(...):
    bpy.ops.screen.screen_full_area()
1 Like