How can I detect and/or change the active tab in the current editor via Python?
Is this doable? I have been digging through bpy.context.region/screen and not yet found a way to list the active tab.
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 community
This isn't currently exposed to the API (but we can expose it if it's useful).
If you mean that you want to turn, let's say, your current editor to the UV Image Editor, you could use the following code:
bpy.context.area.type = 'IMAGE_EDITOR'
Here are the rest of the strings you put for different screens:
3D Object Editor - 'VIEW_3D' Timeline editor - 'TIMELINE' Graph Editor - 'GRAPH_EDITOR' Dopesheet Editor - 'DOPESHEET_EDITOR' NLA Editor - 'NLA_EDITOR' UV Image Editor - 'IMAGE_EDITOR' Sequence Editor - 'SEQUENCE_EDITOR' Clip Editor - 'CLIP_EDITOR' Text Editor - 'TEXT_EDITOR' Node Editor - 'NODE_EDITOR' Game Logic Editor - 'LOGIC_EDITOR' Properties Panel - 'PROPERTIES_EDITOR' Outliner - 'OUTLINER' User Preferences Screen - 'USER_PREFERENCES' Info Panel - 'INFO' File Browser - 'FILE_BROWSER' Python Console - 'CONSOLE'
(The colours above don't mean anything)
So if you want to switch to the file browser, you would do:
bpy.context.area.type = 'FILE_BROWSER'