2.5:
[blender.git] / release / ui / space_view3d_toolbar.py
1
2 import bpy
3
4 # ********** default tools for objectmode ****************
5
6 class View3DPanel(bpy.types.Panel):
7         __space_type__ = "VIEW_3D"
8         __region_type__ = "TOOLS"
9         __context__ = "objectmode"
10
11 class VIEW3D_PT_tools_objectmode(View3DPanel):
12         __idname__ = "VIEW3D_PT_tools_objectmode"
13         __label__ = "Object Tools"
14
15         def draw(self, context):
16                 layout = self.layout
17
18                 layout.row().itemO("OBJECT_OT_duplicate")
19                 layout.row().itemO("OBJECT_OT_delete")
20                 layout.row().itemO("OBJECT_OT_mesh_add")
21                 layout.row().itemO("OBJECT_OT_curve_add")
22                 layout.row().itemO("OBJECT_OT_text_add")
23                 layout.row().itemO("OBJECT_OT_surface_add")
24
25 # ********** default tools for editmode_mesh ****************
26
27 class View3DPanel(bpy.types.Panel):
28         __space_type__ = "VIEW_3D"
29         __region_type__ = "TOOLS"
30         __context__ = "editmode_mesh"
31
32 class VIEW3D_PT_tools_editmode_mesh(View3DPanel):
33         __idname__ = "VIEW3D_PT_tools_editmode_mesh"
34         __label__ = "Mesh Tools"
35
36         def draw(self, context):
37                 layout = self.layout
38
39                 layout.row().itemO("MESH_OT_duplicate")
40                 layout.row().itemO("MESH_OT_delete")
41                 layout.row().itemO("MESH_OT_spin")
42                 layout.row().itemO("MESH_OT_screw")
43                 layout.row().itemO("MESH_OT_primitive_plane_add")
44                 layout.row().itemO("MESH_OT_primitive_cube_add")
45                 layout.row().itemO("MESH_OT_primitive_circle_add")
46                 layout.row().itemO("MESH_OT_primitive_cylinder_add")
47
48 # ********** default tools for editmode_curve ****************
49
50 class View3DPanel(bpy.types.Panel):
51         __space_type__ = "VIEW_3D"
52         __region_type__ = "TOOLS"
53         __context__ = "editmode_curve"
54
55 class VIEW3D_PT_tools_editmode_curve(View3DPanel):
56         __idname__ = "VIEW3D_PT_tools_editmode_curve"
57         __label__ = "Curve Tools"
58
59         def draw(self, context):
60                 layout = self.layout
61
62                 layout.row().itemO("CURVE_OT_duplicate")
63                 layout.row().itemO("CURVE_OT_delete")
64                 layout.row().itemO("OBJECT_OT_curve_add")
65                 layout.row().itemO("CURVE_OT_subdivide")
66
67 # ********** default tools for editmode_surface ****************
68
69 class View3DPanel(bpy.types.Panel):
70         __space_type__ = "VIEW_3D"
71         __region_type__ = "TOOLS"
72         __context__ = "editmode_surface"
73
74 class VIEW3D_PT_tools_editmode_surface(View3DPanel):
75         __idname__ = "VIEW3D_PT_tools_editmode_surface"
76         __label__ = "Surface Tools"
77
78         def draw(self, context):
79                 layout = self.layout
80
81                 layout.row().itemO("CURVE_OT_duplicate")
82                 layout.row().itemO("CURVE_OT_delete")
83                 layout.row().itemO("OBJECT_OT_surface_add")
84                 layout.row().itemO("CURVE_OT_subdivide")
85
86 # ********** default tools for editmode_text ****************
87
88 class View3DPanel(bpy.types.Panel):
89         __space_type__ = "VIEW_3D"
90         __region_type__ = "TOOLS"
91         __context__ = "editmode_text"
92
93 class VIEW3D_PT_tools_editmode_text(View3DPanel):
94         __idname__ = "VIEW3D_PT_tools_editmode_text"
95         __label__ = "Text Tools"
96
97         def draw(self, context):
98                 layout = self.layout
99
100                 layout.row().itemO("FONT_OT_text_copy")
101                 layout.row().itemO("FONT_OT_text_paste")
102                 layout.row().itemO("FONT_OT_case_set")
103                 layout.row().itemO("FONT_OT_style_toggle")
104
105 # ********** default tools for editmode_armature ****************
106
107 class View3DPanel(bpy.types.Panel):
108         __space_type__ = "VIEW_3D"
109         __region_type__ = "TOOLS"
110         __context__ = "editmode_armature"
111
112 class VIEW3D_PT_tools_editmode_armature(View3DPanel):
113         __idname__ = "VIEW3D_PT_tools_editmode_armature"
114         __label__ = "Armature Tools"
115
116         def draw(self, context):
117                 layout = self.layout
118
119                 layout.row().itemO("ARMATURE_OT_duplicate_selected")
120                 layout.row().itemO("ARMATURE_OT_bone_primitive_add")
121                 layout.row().itemO("ARMATURE_OT_delete")
122                 layout.row().itemO("ARMATURE_OT_parent_clear")
123
124 # ********** default tools for editmode_mball ****************
125
126 class View3DPanel(bpy.types.Panel):
127         __space_type__ = "VIEW_3D"
128         __region_type__ = "TOOLS"
129         __context__ = "editmode_mball"
130
131 class VIEW3D_PT_tools_editmode_mball(View3DPanel):
132         __idname__ = "VIEW3D_PT_tools_editmode_mball"
133         __label__ = "Meta Tools"
134
135         def draw(self, context):
136                 layout = self.layout
137
138                 row = layout.row()
139
140 # ********** default tools for editmode_lattice ****************
141
142 class View3DPanel(bpy.types.Panel):
143         __space_type__ = "VIEW_3D"
144         __region_type__ = "TOOLS"
145         __context__ = "editmode_lattice"
146
147 class VIEW3D_PT_tools_editmode_lattice(View3DPanel):
148         __idname__ = "VIEW3D_PT_tools_editmode_lattice"
149         __label__ = "Lattice Tools"
150
151         def draw(self, context):
152                 layout = self.layout
153
154                 row = layout.row()
155
156 # ********** default tools for posemode ****************
157
158 class View3DPanel(bpy.types.Panel):
159         __space_type__ = "VIEW_3D"
160         __region_type__ = "TOOLS"
161         __context__ = "posemode"
162
163 class VIEW3D_PT_tools_posemode(View3DPanel):
164         __idname__ = "VIEW3D_PT_tools_posemode"
165         __label__ = "Pose Tools"
166
167         def draw(self, context):
168                 layout = self.layout
169
170                 layout.row().itemO("POSE_OT_hide")
171                 layout.row().itemO("POSE_OT_reveal")
172                 layout.row().itemO("POSE_OT_rot_clear")
173                 layout.row().itemO("POSE_OT_loc_clear")
174
175 # ********** default tools for sculptmode ****************
176
177 class View3DPanel(bpy.types.Panel):
178         __space_type__ = "VIEW_3D"
179         __region_type__ = "TOOLS"
180         __context__ = "sculptmode"
181
182 class VIEW3D_PT_tools_sculptmode(View3DPanel):
183         __idname__ = "VIEW3D_PT_tools_sculptmode"
184         __label__ = "Sculpt Tools"
185
186         def draw(self, context):
187                 layout = self.layout
188
189                 layout.row().itemO("SCULPT_OT_radial_control")
190
191 # ********** default tools for weightpaint ****************
192
193 class View3DPanel(bpy.types.Panel):
194         __space_type__ = "VIEW_3D"
195         __region_type__ = "TOOLS"
196         __context__ = "weightpaint"
197
198 class VIEW3D_PT_tools_weightpaint(View3DPanel):
199         __idname__ = "VIEW3D_PT_tools_weightpaint"
200         __label__ = "Weight Paint Tools"
201
202         def draw(self, context):
203                 layout = self.layout
204
205                 layout.row().itemO("PAINT_OT_weight_paint_radial_control")
206
207 # ********** default tools for vertexpaint ****************
208
209 class View3DPanel(bpy.types.Panel):
210         __space_type__ = "VIEW_3D"
211         __region_type__ = "TOOLS"
212         __context__ = "vertexpaint"
213
214 class VIEW3D_PT_tools_vertexpaint(View3DPanel):
215         __idname__ = "VIEW3D_PT_tools_vertexpaint"
216         __label__ = "Vertex Paint Tools"
217
218         def draw(self, context):
219                 layout = self.layout
220
221                 layout.row().itemO("PAINT_OT_vertex_paint_radial_control")
222
223 # ********** default tools for texturepaint ****************
224
225 class View3DPanel(bpy.types.Panel):
226         __space_type__ = "VIEW_3D"
227         __region_type__ = "TOOLS"
228         __context__ = "texturepaint"
229
230 class VIEW3D_PT_tools_texturepaint(View3DPanel):
231         __idname__ = "VIEW3D_PT_tools_texturepaint"
232         __label__ = "Texture Paint Tools"
233
234         def draw(self, context):
235                 layout = self.layout
236
237                 layout.row().itemO("PAINT_OT_texture_paint_radial_control")
238
239
240 bpy.types.register(VIEW3D_PT_tools_objectmode)
241 bpy.types.register(VIEW3D_PT_tools_editmode_mesh)
242 bpy.types.register(VIEW3D_PT_tools_editmode_curve)
243 bpy.types.register(VIEW3D_PT_tools_editmode_surface)
244 bpy.types.register(VIEW3D_PT_tools_editmode_text)
245 bpy.types.register(VIEW3D_PT_tools_editmode_armature)
246 bpy.types.register(VIEW3D_PT_tools_editmode_mball)
247 bpy.types.register(VIEW3D_PT_tools_editmode_lattice)
248 bpy.types.register(VIEW3D_PT_tools_posemode)
249 bpy.types.register(VIEW3D_PT_tools_sculptmode)
250 bpy.types.register(VIEW3D_PT_tools_weightpaint)
251 bpy.types.register(VIEW3D_PT_tools_vertexpaint)
252 bpy.types.register(VIEW3D_PT_tools_texturepaint)
253
254