Found nothing in Python API to set Screen type (other than "Default"
).
Is it possible?
My need is to set it programmatically, with python script !
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.
Sign up to join this communityFound nothing in Python API to set Screen type (other than "Default"
).
Is it possible?
My need is to set it programmatically, with python script !
bpy.context.screen
is a shorthand, but read-only.
You can set a screen via the Window object, which actually holds the screen reference:
bpy.context.window.screen = bpy.data.screens['UV Editing']
There's also an operator to change screen by a number, relative to the currently active screen:
bpy.ops.screen.screen_set(delta=1) # select screen after current from list
This is what CtrlLeft and CtrlRight trigger (with a delta of -1 or 1 respectively).
You can use bpy.context.window.screen
= bpy.data.screens['screen_name']
. To see all your screen types, run:
for screen in bpy.data.screens:
print(screen.name)