Sun position: remove unused prop in HDRI mode
[blender-addons.git] / space_view3d_pie_menus / pie_defaults_menu.py
blob8c068c4707b8aa9435229a5a86159434749e14d5
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 #####
19 # <pep8 compliant>
21 bl_info = {
22 "name": "Hotkey: 'Ctrl U'",
23 "description": "Save/Open & File Menus",
24 "blender": (2, 80, 0),
25 "location": "All Editors",
26 "warning": "",
27 "doc_url": "",
28 "category": "Interface"
31 import bpy
32 from bpy.types import (
33 Menu,
34 Operator,
36 import os
39 # Pie Save/Open
40 class PIE_MT_Load_Defaults(Menu):
41 bl_idname = "PIE_MT_loaddefaults"
42 bl_label = "Save Defaults"
44 def draw(self, context):
45 layout = self.layout
46 prefs = context.preferences
47 pie = layout.menu_pie()
48 # 4 - LEFT
49 pie.operator("wm.read_factory_settings", text="Load Factory Settings", icon='IMPORT')
50 # 6 - RIGHT
51 pie.operator("wm.read_factory_userpref", text="Load Factory Preferences", icon='RECOVER_LAST')
52 # 2 - BOTTOM
53 pie.operator("wm.read_userpref", text="Revert to Saved Prefs", icon='NONE')
54 # 8 - TOP
55 pie.operator("wm.save_homefile", text="Save StartUp File", icon='FILE_NEW')
56 # 7 - TOP - LEFT
57 pie.prop(prefs, "use_preferences_save", text="Auto-Save Preferences", icon='LINK_BLEND')
58 # 9 - TOP - RIGHT
59 pie.operator("wm.save_userpref", text="Save User Preferences", icon='NONE')
60 # 1 - BOTTOM - LEFT
61 pie.separator()
62 # 3 - BOTTOM - RIGHT
63 pie.separator()
67 classes = (
68 PIE_MT_Load_Defaults,
71 addon_keymaps = []
74 def register():
75 for cls in classes:
76 bpy.utils.register_class(cls)
78 wm = bpy.context.window_manager
79 if wm.keyconfigs.addon:
80 # Save/Open/...
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))
87 def unregister():
88 for cls in classes:
89 bpy.utils.unregister_class(cls)
91 wm = bpy.context.window_manager
92 kc = wm.keyconfigs.addon
93 if kc:
94 for km, kmi in addon_keymaps:
95 km.keymap_items.remove(kmi)
96 addon_keymaps.clear()
99 if __name__ == "__main__":
100 register()