Skip to content

Instantly share code, notes, and snippets.

@howiemnet
Created January 27, 2017 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howiemnet/c6ec718448bf8f7e21fe846a8873922e to your computer and use it in GitHub Desktop.
Save howiemnet/c6ec718448bf8f7e21fe846a8873922e to your computer and use it in GitHub Desktop.
Blender Screen hotkeys script
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)
@howiemnet
Copy link
Author

  1. 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.
  2. At the bottom, name it "SetScreenLayout.py" or anything else ending in ".py".
  3. 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.)
  4. Check "Register" to the right of it, to have the operator available after restarting Blender.
  5. 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.
  6. For each one, input "screen.set_layout" in the text field on the left and hit enter.
  7. 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).

This was snagged with eternal thanks from user blitzen on BlenderArtists - https://blenderartists.org/forum/showthread.php?246232-Screen-Layout-Hotkeys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment