Remove a specific area

I’m trying to remove a specific area from the screen. There doesn’t seem to be a simple .remove, so I looked for other options.
I found this (https://blender.stackexchange.com/questions/120479/how-to-join-two-areas-using-python) which would have worked fine, but the operator changed in 2.8, so it doesn’t work anymore.
Is there a good way to remove an area with a script?

2 Likes

bumping thread would be great if someone came up with a solution

We did. Since 3.0 you can right-click on any area’s header and select “Close” to remove it. You should be able to call it from a script like this:

area = bpy.context.screen.areas[0]  # Pick any area.
bpy.ops.screen.area_close({"area": area})

https://developer.blender.org/D12307

2 Likes

OP’s question was how to invoke this programmatically from Python, not interactively.

2 Likes

If for example you have two 3D View areas. How would you choose which to remove? As for example identify the currently active area that the user is working on so you pick the other one unused?

1 Like