1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
22 "name": "Hotkey: 'Ctrl U'",
23 "description": "Save/Open & File Menus",
24 "blender": (2, 80, 0),
25 "location": "All Editors",
28 "category": "Interface"
32 from bpy
.types
import (
40 class PIE_MT_Load_Defaults(Menu
):
41 bl_idname
= "PIE_MT_loaddefaults"
42 bl_label
= "Save Defaults"
44 def draw(self
, context
):
46 prefs
= context
.preferences
47 pie
= layout
.menu_pie()
49 pie
.operator("wm.read_factory_settings", text
="Load Factory Settings", icon
='IMPORT')
51 pie
.operator("wm.read_factory_userpref", text
="Load Factory Preferences", icon
='RECOVER_LAST')
53 pie
.operator("wm.read_userpref", text
="Revert to Saved Prefs", icon
='NONE')
55 pie
.operator("wm.save_homefile", text
="Save StartUp File", icon
='FILE_NEW')
57 pie
.prop(prefs
, "use_preferences_save", text
="Auto-Save Preferences", icon
='LINK_BLEND')
59 pie
.operator("wm.save_userpref", text
="Save User Preferences", icon
='NONE')
76 bpy
.utils
.register_class(cls
)
78 wm
= bpy
.context
.window_manager
79 if wm
.keyconfigs
.addon
:
81 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Window')
82 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'U', 'PRESS', ctrl
=True)
83 kmi
.properties
.name
= "PIE_MT_loaddefaults"
84 addon_keymaps
.append((km
, kmi
))
89 bpy
.utils
.unregister_class(cls
)
91 wm
= bpy
.context
.window_manager
92 kc
= wm
.keyconfigs
.addon
94 for km
, kmi
in addon_keymaps
:
95 km
.keymap_items
.remove(kmi
)
99 if __name__
== "__main__":