Alternative workflow for creating/merging areas in 3.0

This is not a script per se but 5 keymaps to manage the creation and merging of areas.
In 3.0 a new operator was introduced for closing the active area in one single step so I thought getting everything in one shortcut would be useful for a more flexible workflow

Example:

It uses Ctrl+Shift+Alt / LeftClick for everything

Double click removes the area
Holding and moving horizontally/vertically splits

Here is the script for adding the keymaps (or you can do it manually using the last picture)

import bpy

wm = bpy.context.window_manager
kc = wm.keyconfigs.default
km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW')

kmi = km.keymap_items.new('screen.area_split',type='EVT_TWEAK_L', value= 'EAST', shift= True, ctrl=True, alt=True)
kmi.properties.direction = 'HORIZONTAL'

kmi = km.keymap_items.new('screen.area_split',type='EVT_TWEAK_L', value= 'WEST', shift= True, ctrl=True, alt=True)
kmi.properties.direction = 'HORIZONTAL'

kmi = km.keymap_items.new('screen.area_split',type='EVT_TWEAK_L', value= 'NORTH', shift= True, ctrl=True, alt=True)
kmi.properties.direction = 'VERTICAL'

kmi = km.keymap_items.new('screen.area_split',type='EVT_TWEAK_L', value= 'SOUTH', shift= True, ctrl=True, alt=True)
kmi.properties.direction = 'VERTICAL'

kmi = km.keymap_items.new('screen.area_close',type='LEFTMOUSE', value= 'DOUBLE_CLICK', shift= True, ctrl=True, alt=True)

You can delete or change them in the Keymap tab > Screen > Screen Editing

6 Likes

Thank you !

1 Like