1 # SPDX-FileCopyrightText: 2016-2022 Blender Foundation
3 # 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')
59 bpy
.utils
.register_class(cls
)
61 wm
= bpy
.context
.window_manager
62 if wm
.keyconfigs
.addon
:
64 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Window')
65 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'U', 'PRESS', ctrl
=True)
66 kmi
.properties
.name
= "PIE_MT_loaddefaults"
67 addon_keymaps
.append((km
, kmi
))
72 bpy
.utils
.unregister_class(cls
)
74 wm
= bpy
.context
.window_manager
75 kc
= wm
.keyconfigs
.addon
77 for km
, kmi
in addon_keymaps
:
78 km
.keymap_items
.remove(kmi
)
82 if __name__
== "__main__":