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 #####
22 "name": "Hotkey: 'W'",
23 "description": "Sculpt Brush Menu",
24 "author": "pitiwazou, meta-androcto",
26 "blender": (2, 80, 0),
30 "category": "Sculpt Pie"
34 from bpy
.types
import (
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']
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
):
58 pie
= layout
.menu_pie()
60 pie
.operator("paint.brush_select",
61 text
="Crease", icon
='BRUSH_CREASE').sculpt_tool
= 'CREASE'
63 pie
.operator("paint.brush_select",
64 text
='Blob', icon
='BRUSH_BLOB').sculpt_tool
= 'BLOB'
66 pie
.menu(PieSculpttwo
.bl_idname
,
67 text
="More Brushes", icon
='BRUSH_SMOOTH')
69 pie
.operator("sculpt.sculptraw",
70 text
='SculptDraw', icon
='BRUSH_SCULPT_DRAW')
72 pie
.operator("paint.brush_select",
73 text
="Clay", icon
='BRUSH_CLAY').sculpt_tool
= 'CLAY'
75 pie
.operator("paint.brush_select",
76 text
='Claystrips', icon
='BRUSH_CLAY_STRIPS').sculpt_tool
= 'CLAY_STRIPS'
78 pie
.operator("paint.brush_select",
79 text
='Inflate/Deflate', icon
='BRUSH_INFLATE').sculpt_tool
= 'INFLATE'
81 pie
.menu(PieSculptthree
.bl_idname
,
82 text
="Grab Brushes", icon
='BRUSH_GRAB')
86 class PieSculpttwo(Menu
):
87 bl_idname
= "PIE_MT_sculpttwo"
88 bl_label
= "Pie Sculpt 2"
90 def draw(self
, context
):
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'
110 class PieSculptthree(Menu
):
111 bl_idname
= "PIE_MT_sculptthree"
112 bl_label
= "Pie Sculpt 3"
114 def draw(self
, context
):
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'
141 bpy
.utils
.register_class(cls
)
143 wm
= bpy
.context
.window_manager
144 if wm
.keyconfigs
.addon
:
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
))
154 bpy
.utils
.unregister_class(cls
)
156 wm
= bpy
.context
.window_manager
157 kc
= wm
.keyconfigs
.addon
159 for km
, kmi
in addon_keymaps
:
160 km
.keymap_items
.remove(kmi
)
161 addon_keymaps
.clear()
164 if __name__
== "__main__":