Sun position: remove unused prop in HDRI mode
[blender-addons.git] / space_view3d_pie_menus / pie_delete_menu.py
blob97e0c7745cd1b367e6eee7a57692499f506274fc
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: 'X'",
23 "description": "Edit mode V/E/F Delete Modes",
24 "author": "pitiwazou, meta-androcto",
25 "version": (0, 1, 0),
26 "blender": (2, 80, 0),
27 "location": "Mesh Edit Mode",
28 "warning": "",
29 "doc_url": "",
30 "category": "Edit Delete Pie"
33 import bpy
34 from bpy.types import Menu
37 # Pie Delete - X
38 class PIE_MT_PieDelete(Menu):
39 bl_idname = "PIE_MT_delete"
40 bl_label = "Pie Delete"
42 def draw(self, context):
43 layout = self.layout
44 pie = layout.menu_pie()
45 # 4 - LEFT
46 box = pie.split().column()
47 box.operator("mesh.dissolve_limited", text="Limited Dissolve", icon='STICKY_UVS_LOC')
48 box.operator("mesh.delete_edgeloop", text="Delete Edge Loops", icon='NONE')
49 box.operator("mesh.edge_collapse", text="Edge Collapse", icon='UV_EDGESEL')
50 # 6 - RIGHT
51 box = pie.split().column()
52 box.operator("mesh.remove_doubles", text="Merge By Distance", icon='NONE')
53 box.operator("mesh.delete", text="Only Edge & Faces", icon='NONE').type = 'EDGE_FACE'
54 box.operator("mesh.delete", text="Only Faces", icon='UV_FACESEL').type = 'ONLY_FACE'
55 # 2 - BOTTOM
56 pie.operator("mesh.dissolve_edges", text="Dissolve Edges", icon='SNAP_EDGE')
57 # 8 - TOP
58 pie.operator("mesh.delete", text="Delete Edges", icon='EDGESEL').type = 'EDGE'
59 # 7 - TOP - LEFT
60 pie.operator("mesh.delete", text="Delete Vertices", icon='VERTEXSEL').type = 'VERT'
61 # 9 - TOP - RIGHT
62 pie.operator("mesh.delete", text="Delete Faces", icon='FACESEL').type = 'FACE'
63 # 1 - BOTTOM - LEFT
64 pie.operator("mesh.dissolve_verts", text="Dissolve Vertices", icon='SNAP_VERTEX')
65 # 3 - BOTTOM - RIGHT
66 pie.operator("mesh.dissolve_faces", text="Dissolve Faces", icon='SNAP_FACE')
69 classes = (
70 PIE_MT_PieDelete,
74 addon_keymaps = []
77 def register():
78 for cls in classes:
79 bpy.utils.register_class(cls)
81 wm = bpy.context.window_manager
82 if wm.keyconfigs.addon:
83 # Delete
84 km = wm.keyconfigs.addon.keymaps.new(name='Mesh')
85 kmi = km.keymap_items.new('wm.call_menu_pie', 'X', 'PRESS')
86 kmi.properties.name = "PIE_MT_delete"
87 addon_keymaps.append((km, kmi))
90 def unregister():
91 for cls in classes:
92 bpy.utils.unregister_class(cls)
94 wm = bpy.context.window_manager
95 kc = wm.keyconfigs.addon
96 if kc:
97 for km, kmi in addon_keymaps:
98 km.keymap_items.remove(kmi)
99 addon_keymaps.clear()
102 if __name__ == "__main__":
103 register()