1 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Hotkey: 'Ctrl U'",
7 "description": "Save/Open & File Menus",
9 "location": "All Editors",
12 "category": "Interface"
16 from bpy
.types
import (
24 class PIE_MT_Load_Defaults(Menu
):
25 bl_idname
= "PIE_MT_loaddefaults"
26 bl_label
= "Save Defaults"
28 def draw(self
, context
):
30 prefs
= context
.preferences
31 pie
= layout
.menu_pie()
33 pie
.operator("wm.read_factory_settings", text
="Load Factory Settings", icon
='IMPORT')
35 pie
.operator("wm.read_factory_userpref", text
="Load Factory Preferences", icon
='RECOVER_LAST')
37 pie
.operator("wm.read_userpref", text
="Revert to Saved Prefs", icon
='NONE')
39 pie
.operator("wm.save_homefile", text
="Save StartUp File", icon
='FILE_NEW')
41 pie
.prop(prefs
, "use_preferences_save", text
="Auto-Save Preferences", icon
='LINK_BLEND')
43 pie
.operator("wm.save_userpref", text
="Save User Preferences", icon
='NONE')
60 bpy
.utils
.register_class(cls
)
62 wm
= bpy
.context
.window_manager
63 if wm
.keyconfigs
.addon
:
65 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Window')
66 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'U', 'PRESS', ctrl
=True)
67 kmi
.properties
.name
= "PIE_MT_loaddefaults"
68 addon_keymaps
.append((km
, kmi
))
73 bpy
.utils
.unregister_class(cls
)
75 wm
= bpy
.context
.window_manager
76 kc
= wm
.keyconfigs
.addon
78 for km
, kmi
in addon_keymaps
:
79 km
.keymap_items
.remove(kmi
)
83 if __name__
== "__main__":