4
$\begingroup$

My screen has different areas: one 3D View and two Image Editors.

I would like to split one of the Image Editors but when I call the bpy.ops.screen.area_split() operator, it's always going to split the 3D View for whatever reason.

Does anyone know how I can split a certain area?

$\endgroup$
1
2
$\begingroup$

Iterate through all visible areas and override the context when calling area_split() operator:

import bpy

for area in bpy.context.screen.areas:
    if area.type == 'IMAGE_EDITOR': # 'VIEW_3D', 'CONSOLE', 'INFO' etc. 
        override = bpy.context.copy()
        override['area'] = area
        bpy.ops.screen.area_split(override, direction='VERTICAL', factor=0.3)
        break
$\endgroup$
1
  • 1
    $\begingroup$ Was off searchin' for a particular answer on this, didn't see yours. Closed and Re-opened. $\endgroup$ – batFINGER Mar 13 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.