Update addons for changes to proportional edit mode
[blender-addons.git] / space_view3d_pie_menus / pie_sculpt_menu.py
blob93e03955927df1a3800ffc8bea3455bf092bfc31
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: 'W'",
23 "description": "Sculpt Brush Menu",
24 "author": "pitiwazou, meta-androcto",
25 "version": (0, 1, 0),
26 "blender": (2, 80, 0),
27 "location": "W key",
28 "warning": "",
29 "wiki_url": "",
30 "category": "Sculpt Pie"
33 import bpy
34 from bpy.types import (
35 Menu,
36 Operator,
40 # Sculpt Draw
41 class SculptSculptDraw(Operator):
42 bl_idname = "sculpt.sculptraw"
43 bl_label = "Sculpt SculptDraw"
44 bl_options = {'REGISTER', 'UNDO'}
46 def execute(self, context):
47 context.tool_settings.sculpt.brush = bpy.data.brushes['SculptDraw']
48 return {'FINISHED'}
51 # Pie Sculp Pie Menus - W
52 class PieSculptPie(Menu):
53 bl_idname = "PIE_MT_sculpt"
54 bl_label = "Pie Sculpt"
56 def draw(self, context):
57 layout = self.layout
58 pie = layout.menu_pie()
59 # 4 - LEFT
60 pie.operator("paint.brush_select",
61 text="Crease", icon='BRUSH_CREASE').sculpt_tool = 'CREASE'
62 # 6 - RIGHT
63 pie.operator("paint.brush_select",
64 text='Blob', icon='BRUSH_BLOB').sculpt_tool = 'BLOB'
65 # 2 - BOTTOM
66 pie.menu(PieSculpttwo.bl_idname,
67 text="More Brushes", icon='BRUSH_SMOOTH')
68 # 8 - TOP
69 pie.operator("sculpt.sculptraw",
70 text='SculptDraw', icon='BRUSH_SCULPT_DRAW')
71 # 7 - TOP - LEFT
72 pie.operator("paint.brush_select",
73 text="Clay", icon='BRUSH_CLAY').sculpt_tool = 'CLAY'
74 # 9 - TOP - RIGHT
75 pie.operator("paint.brush_select",
76 text='Claystrips', icon='BRUSH_CLAY_STRIPS').sculpt_tool = 'CLAY_STRIPS'
77 # 1 - BOTTOM - LEFT
78 pie.operator("paint.brush_select",
79 text='Inflate/Deflate', icon='BRUSH_INFLATE').sculpt_tool = 'INFLATE'
80 # 3 - BOTTOM - RIGHT
81 pie.menu(PieSculptthree.bl_idname,
82 text="Grab Brushes", icon='BRUSH_GRAB')
85 # Pie Sculpt 2
86 class PieSculpttwo(Menu):
87 bl_idname = "PIE_MT_sculpttwo"
88 bl_label = "Pie Sculpt 2"
90 def draw(self, context):
91 layout = self.layout
93 layout.operator("paint.brush_select", text='Smooth',
94 icon='BRUSH_SMOOTH').sculpt_tool = 'SMOOTH'
95 layout.operator("paint.brush_select", text='Flatten',
96 icon='BRUSH_FLATTEN').sculpt_tool = 'FLATTEN'
97 layout.operator("paint.brush_select", text='Scrape/Peaks',
98 icon='BRUSH_SCRAPE').sculpt_tool = 'SCRAPE'
99 layout.operator("paint.brush_select", text='Fill/Deepen',
100 icon='BRUSH_FILL').sculpt_tool = 'FILL'
101 layout.operator("paint.brush_select", text='Pinch/Magnify',
102 icon='BRUSH_PINCH').sculpt_tool = 'PINCH'
103 layout.operator("paint.brush_select", text='Layer',
104 icon='BRUSH_LAYER').sculpt_tool = 'LAYER'
105 layout.operator("paint.brush_select", text='Mask',
106 icon='BRUSH_MASK').sculpt_tool = 'MASK'
109 # Pie Sculpt Three
110 class PieSculptthree(Menu):
111 bl_idname = "PIE_MT_sculptthree"
112 bl_label = "Pie Sculpt 3"
114 def draw(self, context):
115 layout = self.layout
117 layout.operator("paint.brush_select",
118 text='Grab', icon='BRUSH_GRAB').sculpt_tool = 'GRAB'
119 layout.operator("paint.brush_select",
120 text='Nudge', icon='BRUSH_NUDGE').sculpt_tool = 'NUDGE'
121 layout.operator("paint.brush_select",
122 text='Thumb', icon='BRUSH_THUMB').sculpt_tool = 'THUMB'
123 layout.operator("paint.brush_select",
124 text='Snakehook', icon='BRUSH_SNAKE_HOOK').sculpt_tool = 'SNAKE_HOOK'
125 layout.operator("paint.brush_select",
126 text='Rotate', icon='BRUSH_ROTATE').sculpt_tool = 'ROTATE'
129 classes = (
130 PieSculptPie,
131 PieSculpttwo,
132 PieSculptthree,
133 SculptSculptDraw,
136 addon_keymaps = []
139 def register():
140 for cls in classes:
141 bpy.utils.register_class(cls)
143 wm = bpy.context.window_manager
144 if wm.keyconfigs.addon:
145 # Sculpt Pie Menu
146 km = wm.keyconfigs.addon.keymaps.new(name='Sculpt')
147 kmi = km.keymap_items.new('wm.call_menu_pie', 'W', 'PRESS')
148 kmi.properties.name = "PIE_MT_sculpt"
149 addon_keymaps.append((km, kmi))
152 def unregister():
153 for cls in classes:
154 bpy.utils.unregister_class(cls)
156 wm = bpy.context.window_manager
157 kc = wm.keyconfigs.addon
158 if kc:
159 for km, kmi in addon_keymaps:
160 km.keymap_items.remove(kmi)
161 addon_keymaps.clear()
164 if __name__ == "__main__":
165 register()