Screen Layout Hotkeys

I’d like to bind a hotkey to each of the screen layouts specifically (Animation, Default, Compositing, UV Editing, etc.).

Ctrl-Right and Ctrl-Left are bound to screen.screen_set which seems to take a delta parameter. How can one set it to an absolute, either by number or name?

You should be able to change your hotkeys from the User Preferences window (Ctrl+Alt+U) And going into the input-tab. This tab will probably be confusing, as there are hundreds of settings here.
I can’t help you further, as I’m still new to Blender.

Right. The question remains, for this purpose, as to what to set them to.

I posted the solution in Python Support. Having spent the last 3 days and nights straight finally figuring it out, here it is:

  • Paste the following script into the Text Editor window, which you may find in the “Game Logic” or “Scripting” screen layouts in the drop-down menu at the top of the screen. This will be the last time you’ll have to click on the fraggin’ thing with your mouse.
import bpy
class SetScreenLayout(bpy.types.Operator):
    """Switches to the screen layout of the given name."""
    bl_idname="screen.set_layout"
    bl_label="Switch to Screen Layout"
    layoutNamme=bpy.props.StringProperty()
    def execute(self,context):
        bpy.context.window.screen=bpy.data.screens[self.layoutNamme]
        return{'FINISHED'}
    def invoke(self,context,event):
        return self.execute(context)
bpy.utils.register_class(SetScreenLayout)
  • At the bottom, name it “SetScreenLayout.py” or anything else ending in “.py”.
  • Click the “Run Script” button on the bottom bar to apply it to this session. (You may have to scroll to the right of the bottom bar to find it.)
  • Check “Register” to the right of it, to have the operator available after restarting Blender.
  • Go to File->Preferences, Input tab, and under an appropriate subcategory such as “Screen -> Screen (Global)”, click “Add New” for as many screen layouts as you want shortcuts for. I used Ctrl-Alt-F1 through F4 as those seem not to be taken.
  • For each one, input “screen.set_layout” in the text field on the left and hit enter.
  • To the right of “layoutNamme” that appears below, input the name of the screen layout you want the key combo to switch to, from the pull-down list at the top (“Default”, “UV Editing”, “Animation”, “Compositing”, “Game Logic”, “Scripting”, or your own custom-made layouts).
  • Profit.

I undoubtedly spent more time getting the fraggin’ hotkeys to work than the combined time they will save me for the rest of my Blender career, but I’m German and don’t know how to surrender. Good day.

1 Like

Awesome. Should really be integrated into main.

I undoubtedly spent more time getting the fraggin’ hotkeys to work than the combined time they will save me for the rest of my Blender career, but I’m German and don’t know how to surrender. Good day.

Thanks very much for your perseverance on this.

This is awesome! Thanks!