[addon] Set screen layout by using shortcuts

I was looking for a solution on how to keep each screen layout per scene. though i havent found this yet i bumped into this thread about using shortcuts for given screen layouts.

Blitzen provided a handy script so you can assign shortcuts to certain screens. I found quite useful so i converted it to a addon.

Here’s the small script. and the original post

This is the workflow for it

  • 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.

Attachments

SetScreenLayout2.py.zip (1.08 KB)

1 Like

Thanks for sharing

let me just plug this here, hope you dont mind https://github.com/kilbee/kbPIEs

[QUOTE=kilbee;3156207]let me just plug this here, hope you dont mind https://github.com/kilbee/kbPIEs[/]
But i see yours was already working. This script does the same except users dont need to copy paste that code. I believe thats the only difference right?

Your setup is quite nice with that addon info. But i dont get the naming there, first it thought adding the names there would automatically make those short cuts. I think we could link these 2 together so the user only needs to input corresponding names and hotkey and then they would be added. That would be the ideal solution.

I looked at the preferences and adding a keycode is wm.keyitem_add() I we then add the name from the name field and key input field the user wont need todo anything coding themselves :slight_smile:

In theary then, didnt test it yet

Yep, exactly the reason I plugged it, I was hoping someone would pick it up :wink: since I’m quite busy atm and I do think setup should be much easier (like setting up layouts from enums, not typing, etc.).

And also checking if there is any interest in this - because the pie menu from my link is enough for me - one time setup and simple switching… I do however realise that this tedious setup is scaring off people from using it, so my question is: is it worth improving? Would anybody use this?
If so i will keep it in mind as a ‘todo’.

Had started a bit of adding the dropdown menu a while back. Do you mind i use your code for that? I can update mine than for easier setup

For the peeps who like this one, i did some updates. You can now set the shortcuts directly from the addon pref menu. Ive also added a quick call menu.

This is how the addon pref menu looks now

The quick call menu popsup like this.
18%20PM

You can download it here from gitHub

1 Like