Split Screen Area¶
Splits the current screen area into a new editor of the requested type, or joins a matching neighbour back into the current area when one already exists on the requested side. Used by the InteractionOps split pie to build and tear down viewport / editor layouts with a single shortcut. The companion iops.switch_screen_area operator toggles the current area's type in place, or closes it when it already matches.
Split Screen Area (bl_idname: iops.split_screen_area)¶
Overview¶
Given a target ui_type, a pos (LEFT/RIGHT/TOP/BOTTOM), and a split factor, the operator either:
- Joins an adjacent area on
posback into the current area when that neighbour'sui_typematchesui(callingiops.space_data_saveon the neighbour first). - If the current area already is
ui, joins the neighbour on the mirrored side back into the current one. - Otherwise splits the current area with
screen.area_split, sets the new area'stype/ui_type, optionally swaps it with the original viascreen.area_swapso the new editor lands on the requested side, then restores its space data viaiops.space_data_load.
If the screen is in toggled fullscreen (nonnormal in screen name), it exits fullscreen with hidden panels and returns. A factor of exactly 0.5 is clamped to 0.499 to work around a Blender split quirk.
Usage¶
- Invoked from the InteractionOps Split pie (
ui/iops_pie_split.py) with the modifier-driven primary / alternate editor slots from preferences. No default keymap binding on the operator itself. - Callers pass
area_type,ui(Blenderui_typestring),pos, andfactor.
Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
area_type |
StringProperty | "" |
Blender area type to assign to the new area (e.g. VIEW_3D, IMAGE_EDITOR). |
ui |
StringProperty | "" |
Blender ui_type to assign / match against (e.g. VIEW_3D, UV, ShaderNodeTree). |
pos |
StringProperty | "" |
Side relative to the current area: LEFT, RIGHT, TOP, BOTTOM. |
factor |
FloatProperty | 0.01 |
Split factor; soft range 0.01..1, step 0.01, precision 2. 0.5 is internally clamped to 0.499. |
Notes¶
- Depends on
iops.space_data_save/iops.space_data_loadto round-trip per-editor settings across the join/split. - Uses
bpy.context.temp_overrideplus a manual context override helper to drivescreen.*operators on the correct window/screen/area/region. - "Joining" requires the neighbour to span the same width/height and align on the matching edge; otherwise the operator falls through to a split.
Switch Screen Area (bl_idname: iops.switch_screen_area)¶
Overview¶
Toggles the current area between its existing editor and a requested area_type / ui pair:
- If the current area already matches both
area_typeandui, callsscreen.area_closeon it (skipped silently if only one area remains or the operator's poll fails). - Otherwise sets
area.typeandarea.ui_typeto the requested values and callsiops.space_data_loadunder a context override to restore that editor's stored space data. - When the screen is in toggled fullscreen, it exits fullscreen with hidden panels and returns.
Usage¶
- Invoked from the InteractionOps Split pie with the Alt modifier. No default keymap binding on the operator itself.
Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
area_type |
StringProperty | "" |
Blender area type to switch to / compare against. |
ui |
StringProperty | "" |
Blender ui_type to switch to / compare against. |
Notes¶
- Will not close the last remaining area on the screen.
- Errors from
area_close/space_data_loadare swallowed to keep the pie responsive.