Audaspace Py API documentation fixes.
[blender.git] / release / scripts / ui / space_view3d_toolbar.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
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.
7 #
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.
12 #
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.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21
22 narrowui = bpy.context.user_preferences.view.properties_width_check
23
24 class View3DPanel(bpy.types.Panel):
25     bl_space_type = 'VIEW_3D'
26     bl_region_type = 'TOOLS'
27
28
29 # ********** default tools for objectmode ****************
30
31
32 class VIEW3D_PT_tools_objectmode(View3DPanel):
33     bl_context = "objectmode"
34     bl_label = "Object Tools"
35
36     def draw(self, context):
37         layout = self.layout
38
39         col = layout.column(align=True)
40         col.label(text="Transform:")
41         col.operator("transform.translate")
42         col.operator("transform.rotate")
43         col.operator("transform.resize", text="Scale")
44
45         col = layout.column(align=True)
46         col.operator("object.origin_set", text="Origin")
47
48         col = layout.column(align=True)
49         col.label(text="Object:")
50         col.operator("object.duplicate_move")
51         col.operator("object.delete")
52         col.operator("object.join")
53
54         active_object = context.active_object
55         if active_object and active_object.type == 'MESH':
56
57             col = layout.column(align=True)
58             col.label(text="Shading:")
59             col.operator("object.shade_smooth", text="Smooth")
60             col.operator("object.shade_flat", text="Flat")
61
62         col = layout.column(align=True)
63         col.label(text="Keyframes:")
64         col.operator("anim.keyframe_insert_menu", text="Insert")
65         col.operator("anim.keyframe_delete_v3d", text="Remove")
66
67         col = layout.column(align=True)
68         col.label(text="Repeat:")
69         col.operator("screen.repeat_last")
70         col.operator("screen.repeat_history", text="History...")
71
72         col = layout.column(align=True)
73         col.label(text="Grease Pencil:")
74         row = col.row()
75         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
76         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
77         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
78
79 # ********** default tools for editmode_mesh ****************
80
81
82 class VIEW3D_PT_tools_meshedit(View3DPanel):
83     bl_context = "mesh_edit"
84     bl_label = "Mesh Tools"
85
86     def draw(self, context):
87         layout = self.layout
88
89         col = layout.column(align=True)
90         col.label(text="Transform:")
91         col.operator("transform.translate")
92         col.operator("transform.rotate")
93         col.operator("transform.resize", text="Scale")
94         col.operator("transform.shrink_fatten", text="Along Normal")
95
96
97         col = layout.column(align=True)
98         col.label(text="Deform:")
99         col.operator("transform.edge_slide")
100         col.operator("mesh.rip_move")
101         col.operator("mesh.vertices_smooth")
102
103
104         col = layout.column(align=True)
105         col.label(text="Add:")
106         col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
107         col.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
108         col.operator("mesh.subdivide")
109         col.operator("mesh.loopcut_slide")
110         col.operator("mesh.duplicate_move", text="Duplicate")
111         col.operator("mesh.spin")
112         col.operator("mesh.screw")
113
114         col = layout.column(align=True)
115         col.label(text="Remove:")
116         col.operator("mesh.delete")
117         col.operator("mesh.merge")
118         col.operator("mesh.remove_doubles")
119
120         col = layout.column(align=True)
121         col.label(text="Normals:")
122         col.operator("mesh.normals_make_consistent", text="Recalculate")
123         col.operator("mesh.flip_normals", text="Flip Direction")
124
125         col = layout.column(align=True)
126         col.label(text="UV Mapping:")
127         col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
128         col.operator("mesh.mark_seam")
129         col.operator("mesh.mark_seam", text="Clear Seam").clear = True
130
131
132         col = layout.column(align=True)
133         col.label(text="Shading:")
134         col.operator("mesh.faces_shade_smooth", text="Smooth")
135         col.operator("mesh.faces_shade_flat", text="Flat")
136
137         col = layout.column(align=True)
138         col.label(text="Repeat:")
139         col.operator("screen.repeat_last")
140         col.operator("screen.repeat_history", text="History...")
141
142         col = layout.column(align=True)
143         col.label(text="Grease Pencil:")
144         row = col.row()
145         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
146         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
147         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
148
149
150 class VIEW3D_PT_tools_meshedit_options(View3DPanel):
151     bl_context = "mesh_edit"
152     bl_label = "Mesh Options"
153
154     def draw(self, context):
155         layout = self.layout
156
157         ob = context.active_object
158
159         if ob:
160             mesh = context.active_object.data
161             col = layout.column(align=True)
162             col.prop(mesh, "use_mirror_x")
163             col.prop(mesh, "use_mirror_topology")
164             col.prop(context.tool_settings, "edge_path_mode")
165
166 # ********** default tools for editmode_curve ****************
167
168
169 class VIEW3D_PT_tools_curveedit(View3DPanel):
170     bl_context = "curve_edit"
171     bl_label = "Curve Tools"
172
173     def draw(self, context):
174         layout = self.layout
175
176         col = layout.column(align=True)
177         col.label(text="Transform:")
178         col.operator("transform.translate")
179         col.operator("transform.rotate")
180         col.operator("transform.resize", text="Scale")
181
182         col = layout.column(align=True)
183         col.operator("transform.transform", text="Tilt").mode = 'TILT'
184         col.operator("transform.transform", text="Shrink/Fatten").mode = 'CURVE_SHRINKFATTEN'
185
186         col = layout.column(align=True)
187         col.label(text="Curve:")
188         col.operator("curve.duplicate")
189         col.operator("curve.delete")
190         col.operator("curve.cyclic_toggle")
191         col.operator("curve.switch_direction")
192         col.operator("curve.spline_type_set")
193
194         col = layout.column(align=True)
195         col.label(text="Handles:")
196         row = col.row()
197         row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
198         row.operator("curve.handle_type_set", text="Vector").type = 'VECTOR'
199         row = col.row()
200         row.operator("curve.handle_type_set", text="Align").type = 'ALIGN'
201         row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
202
203         col = layout.column(align=True)
204         col.label(text="Modeling:")
205         col.operator("curve.extrude")
206         col.operator("curve.subdivide")
207
208         col = layout.column(align=True)
209         col.label(text="Repeat:")
210         col.operator("screen.repeat_last")
211         col.operator("screen.repeat_history", text="History...")
212
213         col = layout.column(align=True)
214         col.label(text="Grease Pencil:")
215         row = col.row()
216         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
217         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
218         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
219
220 # ********** default tools for editmode_surface ****************
221
222
223 class VIEW3D_PT_tools_surfaceedit(View3DPanel):
224     bl_context = "surface_edit"
225     bl_label = "Surface Tools"
226
227     def draw(self, context):
228         layout = self.layout
229
230         col = layout.column(align=True)
231         col.label(text="Transform:")
232         col.operator("transform.translate")
233         col.operator("transform.rotate")
234         col.operator("transform.resize", text="Scale")
235
236         col = layout.column(align=True)
237         col.label(text="Curve:")
238         col.operator("curve.duplicate")
239         col.operator("curve.delete")
240         col.operator("curve.cyclic_toggle")
241         col.operator("curve.switch_direction")
242
243         col = layout.column(align=True)
244         col.label(text="Modeling:")
245         col.operator("curve.extrude")
246         col.operator("curve.subdivide")
247
248         col = layout.column(align=True)
249         col.label(text="Repeat:")
250         col.operator("screen.repeat_last")
251         col.operator("screen.repeat_history", text="History...")
252
253         col = layout.column(align=True)
254         col.label(text="Grease Pencil:")
255         row = col.row()
256         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
257         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
258         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
259
260 # ********** default tools for editmode_text ****************
261
262
263 class VIEW3D_PT_tools_textedit(View3DPanel):
264     bl_context = "text_edit"
265     bl_label = "Text Tools"
266
267     def draw(self, context):
268         layout = self.layout
269
270         col = layout.column(align=True)
271         col.label(text="Text Edit:")
272         col.operator("font.text_copy", text="Copy")
273         col.operator("font.text_cut", text="Cut")
274         col.operator("font.text_paste", text="Paste")
275
276         col = layout.column(align=True)
277         col.label(text="Set Case:")
278         col.operator("font.case_set", text="To Upper").case = 'UPPER'
279         col.operator("font.case_set", text="To Lower").case = 'LOWER'
280
281         col = layout.column(align=True)
282         col.label(text="Style:")
283         col.operator("font.style_toggle", text="Bold").style = 'BOLD'
284         col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
285         col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
286
287         col = layout.column(align=True)
288         col.label(text="Repeat:")
289         col.operator("screen.repeat_last")
290         col.operator("screen.repeat_history", text="History...")
291
292
293 # ********** default tools for editmode_armature ****************
294
295
296 class VIEW3D_PT_tools_armatureedit(View3DPanel):
297     bl_context = "armature_edit"
298     bl_label = "Armature Tools"
299
300     def draw(self, context):
301         layout = self.layout
302
303         col = layout.column(align=True)
304         col.label(text="Transform:")
305         col.operator("transform.translate")
306         col.operator("transform.rotate")
307         col.operator("transform.resize", text="Scale")
308
309         col = layout.column(align=True)
310         col.label(text="Bones:")
311         col.operator("armature.bone_primitive_add", text="Add")
312         col.operator("armature.duplicate_move", text="Duplicate")
313         col.operator("armature.delete", text="Delete")
314
315         col = layout.column(align=True)
316         col.label(text="Modeling:")
317         col.operator("armature.extrude_move")
318         col.operator("armature.subdivide_multi", text="Subdivide")
319
320         col = layout.column(align=True)
321         col.label(text="Repeat:")
322         col.operator("screen.repeat_last")
323         col.operator("screen.repeat_history", text="History...")
324
325         col = layout.column(align=True)
326         col.label(text="Grease Pencil:")
327         row = col.row()
328         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
329         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
330         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
331
332
333 class VIEW3D_PT_tools_armatureedit_options(View3DPanel):
334     bl_context = "armature_edit"
335     bl_label = "Armature Options"
336
337     def draw(self, context):
338         layout = self.layout
339
340         arm = context.active_object.data
341
342         col = layout.column(align=True)
343         col.prop(arm, "x_axis_mirror")
344
345 # ********** default tools for editmode_mball ****************
346
347
348 class VIEW3D_PT_tools_mballedit(View3DPanel):
349     bl_context = "mball_edit"
350     bl_label = "Meta Tools"
351
352     def draw(self, context):
353         layout = self.layout
354
355         col = layout.column(align=True)
356         col.label(text="Transform:")
357         col.operator("transform.translate")
358         col.operator("transform.rotate")
359         col.operator("transform.resize", text="Scale")
360
361         col = layout.column(align=True)
362         col.label(text="Repeat:")
363         col.operator("screen.repeat_last")
364         col.operator("screen.repeat_history", text="History...")
365
366         col = layout.column(align=True)
367         col.label(text="Grease Pencil:")
368         row = col.row()
369         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
370         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
371         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
372
373 # ********** default tools for editmode_lattice ****************
374
375
376 class VIEW3D_PT_tools_latticeedit(View3DPanel):
377     bl_context = "lattice_edit"
378     bl_label = "Lattice Tools"
379
380     def draw(self, context):
381         layout = self.layout
382
383         col = layout.column(align=True)
384         col.label(text="Transform:")
385         col.operator("transform.translate")
386         col.operator("transform.rotate")
387         col.operator("transform.resize", text="Scale")
388
389         col = layout.column(align=True)
390         col.operator("lattice.make_regular")
391
392         col = layout.column(align=True)
393         col.label(text="Repeat:")
394         col.operator("screen.repeat_last")
395         col.operator("screen.repeat_history", text="History...")
396
397         col = layout.column(align=True)
398         col.label(text="Grease Pencil:")
399         row = col.row()
400         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
401         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
402         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
403
404
405 # ********** default tools for posemode ****************
406
407
408 class VIEW3D_PT_tools_posemode(View3DPanel):
409     bl_context = "posemode"
410     bl_label = "Pose Tools"
411
412     def draw(self, context):
413         layout = self.layout
414
415         col = layout.column(align=True)
416         col.label(text="Transform:")
417         col.operator("transform.translate")
418         col.operator("transform.rotate")
419         col.operator("transform.resize", text="Scale")
420
421         col = layout.column(align=True)
422         col.label(text="In-Between:")
423         row = col.row()
424         row.operator("pose.push", text="Push")
425         row.operator("pose.relax", text="Relax")
426         col.operator("pose.breakdown", text="Breakdowner")
427
428         col = layout.column(align=True)
429         col.label(text="Pose:")
430         row = col.row()
431         row.operator("pose.copy", text="Copy")
432         row.operator("pose.paste", text="Paste")
433
434         col = layout.column(align=True)
435         col.operator("poselib.pose_add", text="Add To Library")
436
437         col = layout.column(align=True)
438         col.label(text="Keyframes:")
439
440         col.operator("anim.keyframe_insert_menu", text="Insert")
441         col.operator("anim.keyframe_delete_v3d", text="Remove")
442
443         col = layout.column(align=True)
444         col.label(text="Repeat:")
445         col.operator("screen.repeat_last")
446         col.operator("screen.repeat_history", text="History...")
447
448         col = layout.column(align=True)
449         col.label(text="Grease Pencil:")
450         row = col.row()
451         row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
452         row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
453         row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
454
455
456 class VIEW3D_PT_tools_posemode_options(View3DPanel):
457     bl_context = "posemode"
458     bl_label = "Pose Options"
459
460     def draw(self, context):
461         layout = self.layout
462
463         arm = context.active_object.data
464
465         col = layout.column(align=True)
466         col.prop(arm, "x_axis_mirror")
467         col.prop(arm, "auto_ik")
468
469 # ********** default tools for paint modes ****************
470
471
472 class PaintPanel(bpy.types.Panel):
473     bl_space_type = 'VIEW_3D'
474     bl_region_type = 'TOOLS'
475
476     def paint_settings(self, context):
477         ts = context.tool_settings
478
479         if context.sculpt_object:
480             return ts.sculpt
481         elif context.vertex_paint_object:
482             return ts.vertex_paint
483         elif context.weight_paint_object:
484             return ts.weight_paint
485         elif context.texture_paint_object:
486             return ts.image_paint
487         elif context.particle_edit_object:
488             return ts.particle_edit
489
490         return False
491
492
493 class VIEW3D_PT_tools_brush(PaintPanel):
494     bl_label = "Brush"
495
496     def poll(self, context):
497         return self.paint_settings(context)
498
499     def draw(self, context):
500         layout = self.layout
501
502         settings = self.paint_settings(context)
503         brush = settings.brush
504
505         if not context.particle_edit_object:
506             col = layout.split().column()
507
508             if context.sculpt_object and context.tool_settings.sculpt:
509                 col.template_ID_preview(settings, "brush", new="brush.add", filter="is_sculpt_brush", rows=3, cols=8)
510             elif context.texture_paint_object and context.tool_settings.image_paint:
511                 col.template_ID_preview(settings, "brush", new="brush.add", filter="is_imapaint_brush", rows=3, cols=8)
512             elif context.vertex_paint_object and context.tool_settings.vertex_paint:
513                 col.template_ID_preview(settings, "brush", new="brush.add", filter="is_vpaint_brush", rows=3, cols=8)
514             elif context.weight_paint_object and context.tool_settings.weight_paint:
515                 col.template_ID_preview(settings, "brush", new="brush.add", filter="is_wpaint_brush", rows=3, cols=8)
516             else:
517                 row = col.row()
518
519                 if context.sculpt_object and brush:
520                     defaultbrushes = 8
521                 elif context.texture_paint_object and brush:
522                     defaultbrushes = 4
523                 else:
524                     defaultbrushes = 7
525
526                 row.template_list(settings, "brushes", settings, "active_brush_index", rows=2, maxrows=defaultbrushes)
527
528         # Particle Mode #
529
530         # XXX This needs a check if psys is editable.
531         if context.particle_edit_object:
532             # XXX Select Particle System
533             layout.column().prop(settings, "tool", expand=True)
534
535             if settings.tool != 'NONE':
536                 col = layout.column()
537                 col.prop(brush, "size", slider=True)
538                 if settings.tool != 'ADD':
539                     col.prop(brush, "strength", slider=True)
540
541             if settings.tool == 'ADD':
542                 col.prop(brush, "count")
543                 col = layout.column()
544                 col.prop(settings, "add_interpolate")
545                 sub = col.column(align=True)
546                 sub.active = settings.add_interpolate
547                 sub.prop(brush, "steps", slider=True)
548                 sub.prop(settings, "add_keys", slider=True)
549             elif settings.tool == 'LENGTH':
550                 layout.prop(brush, "length_mode", expand=True)
551             elif settings.tool == 'PUFF':
552                 layout.prop(brush, "puff_mode", expand=True)
553                 layout.prop(brush, "use_puff_volume")
554
555         # Sculpt Mode #
556
557         elif context.sculpt_object and brush:
558             edit = context.user_preferences.edit
559
560             col = layout.column()
561
562
563             col.separator()
564
565             row = col.row(align=True)
566
567             if edit.sculpt_paint_use_unified_size:
568                 if edit.sculpt_paint_unified_lock_brush_size:
569                     row.prop(edit, "sculpt_paint_unified_lock_brush_size", toggle=True, text="", icon='LOCKED')
570                     row.prop(edit, "sculpt_paint_unified_unprojected_radius", text="Radius", slider=True)
571                 else:
572                     row.prop(edit, "sculpt_paint_unified_lock_brush_size", toggle=True, text="", icon='UNLOCKED')
573                     row.prop(edit, "sculpt_paint_unified_size", text="Radius", slider=True)
574
575             else:
576                 if brush.lock_brush_size:
577                     row.prop(brush, "lock_brush_size", toggle=True, text="", icon='LOCKED')
578                     row.prop(brush, "unprojected_radius", text="Radius", slider=True)
579                 else:
580                     row.prop(brush, "lock_brush_size", toggle=True, text="", icon='UNLOCKED')
581                     row.prop(brush, "size", text="Radius", slider=True)
582
583             row.prop(brush, "use_size_pressure", toggle=True, text="")
584
585
586             if brush.sculpt_tool not in ('SNAKE_HOOK', 'GRAB', 'ROTATE'):
587                 col.separator()
588
589                 row = col.row(align=True)
590
591                 if brush.use_space and brush.sculpt_tool not in ('SMOOTH'):
592                     if brush.use_space_atten:
593                         row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
594                     else:
595                         row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
596
597                 if edit.sculpt_paint_use_unified_strength:
598                     row.prop(edit, "sculpt_paint_unified_strength", text="Unified Strength", slider=True)
599                 else:
600                     row.prop(brush, "strength", text="Strength", slider=True)
601
602                 row.prop(brush, "use_strength_pressure", text="")
603
604
605
606             if brush.sculpt_tool not in ('SMOOTH'):
607                 col.separator()
608
609                 row = col.row(align=True)
610                 row.prop(brush, "autosmooth_factor", slider=True)
611                 row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
612
613
614
615             if brush.sculpt_tool in ('GRAB', 'SNAKE_HOOK'):
616                 col.separator()
617
618                 row = col.row(align=True)
619                 row.prop(brush, "normal_weight", slider=True)
620
621
622
623             if brush.sculpt_tool in ('CREASE', 'BLOB'):
624                 col.separator()
625
626                 row = col.row(align=True)
627                 row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
628
629             if brush.sculpt_tool not in ('PINCH', 'INFLATE', 'SMOOTH'):
630                 row = col.row(align=True)
631
632                 col.separator()
633
634                 if brush.use_original_normal:
635                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
636                 else:
637                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
638
639                 row.prop(brush, "sculpt_plane", text="")
640
641             #if brush.sculpt_tool in ('CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'):
642             if brush.sculpt_tool in ('CLAY', 'FLATTEN', 'FILL', 'SCRAPE'):
643                 row = col.row(align=True)
644                 row.prop(brush, "plane_offset", slider=True)
645                 row.prop(brush, "use_offset_pressure", text="")
646
647                 col.separator()
648
649                 row= col.row()
650                 row.prop(brush, "use_plane_trim", text="Trim")
651                 row= col.row()
652                 row.active=brush.use_plane_trim
653                 row.prop(brush, "plane_trim", slider=True, text="Distance")
654
655             col.separator()
656
657             row= col.row()
658             row.prop(brush, "use_frontface", text="Front Faces Only")
659
660             #if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'LAYER', 'CLAY', 'CLAY_TUBES'):
661             if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'LAYER', 'CLAY'):
662                 col.separator()
663                 col.row().prop(brush, "direction", expand=True)
664             elif brush.sculpt_tool in ('FLATTEN'):
665                 col.separator()
666                 col.row().prop(brush, "flatten_contrast", expand=True)
667             elif brush.sculpt_tool in ('FILL'):
668                 col.separator()
669                 col.row().prop(brush, "fill_deepen", expand=True)
670             elif brush.sculpt_tool in ('SCRAPE'):
671                 col.separator()
672                 col.row().prop(brush, "scrape_peaks", expand=True)
673             elif brush.sculpt_tool in ('INFLATE'):
674                 col.separator()
675                 col.row().prop(brush, "inflate_deflate", expand=True)
676             elif brush.sculpt_tool in ('PINCH'):
677                 col.separator()
678                 col.row().prop(brush, "pinch_magnify", expand=True)
679
680
681
682             #if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY', 'CLAY_TUBES'):
683             if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'):
684                 col.separator()
685
686                 col.prop(brush, "use_accumulate")
687
688
689
690             if brush.sculpt_tool == 'LAYER':
691                 col.separator()
692
693                 ob = context.sculpt_object
694                 do_persistent = True
695
696                 # not supported yet for this case
697                 for md in ob.modifiers:
698                     if md.type == 'MULTIRES':
699                         do_persistent = False
700
701                 if do_persistent:
702                     col.prop(brush, "use_persistent")
703                     col.operator("sculpt.set_persistent_base")
704
705         # Texture Paint Mode #
706
707         elif context.texture_paint_object and brush:
708             col = layout.column()
709             col.template_color_wheel(brush, "color", value_slider=True)
710             col.prop(brush, "color", text="")
711
712             row = col.row(align=True)
713             row.prop(brush, "size", slider=True)
714             row.prop(brush, "use_size_pressure", toggle=True, text="")
715
716             row = col.row(align=True)
717             row.prop(brush, "strength", slider=True)
718             row.prop(brush, "use_strength_pressure", toggle=True, text="")
719
720             row = col.row(align=True)
721             row.prop(brush, "jitter", slider=True)
722             row.prop(brush, "use_jitter_pressure", toggle=True, text="")
723
724             col.prop(brush, "blend", text="Blend")
725
726             col = layout.column()
727             col.active = (brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'))
728             col.prop(brush, "use_alpha")
729
730
731         # Weight Paint Mode #
732
733         elif context.weight_paint_object and brush:
734             layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
735             layout.prop(context.tool_settings, "auto_normalize", text="Auto Normalize")
736
737             col = layout.column()
738             row = col.row(align=True)
739             row.prop(brush, "size", slider=True)
740             row.prop(brush, "use_size_pressure", toggle=True, text="")
741
742             row = col.row(align=True)
743             row.prop(brush, "strength", slider=True)
744             row.prop(brush, "use_strength_pressure", toggle=True, text="")
745
746             row = col.row(align=True)
747             row.prop(brush, "jitter", slider=True)
748             row.prop(brush, "use_jitter_pressure", toggle=True, text="")
749
750         # Vertex Paint Mode #
751
752         elif context.vertex_paint_object and brush:
753             col = layout.column()
754             col.template_color_wheel(brush, "color", value_slider=True)
755             col.prop(brush, "color", text="")
756
757             row = col.row(align=True)
758             row.prop(brush, "size", slider=True)
759             row.prop(brush, "use_size_pressure", toggle=True, text="")
760
761             row = col.row(align=True)
762             row.prop(brush, "strength", slider=True)
763             row.prop(brush, "use_strength_pressure", toggle=True, text="")
764
765             # XXX - TODO
766             #row = col.row(align=True)
767             #row.prop(brush, "jitter", slider=True)
768             #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
769
770
771 class VIEW3D_PT_tools_brush_texture(PaintPanel):
772     bl_label = "Texture"
773     bl_default_closed = True
774
775     def poll(self, context):
776         settings = self.paint_settings(context)
777         return (settings and settings.brush and (context.sculpt_object or
778                              context.texture_paint_object))
779
780     def draw(self, context):
781         layout = self.layout
782
783         settings = self.paint_settings(context)
784         brush = settings.brush
785         tex_slot = brush.texture_slot
786
787         col = layout.column()
788
789         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
790
791         if context.sculpt_object:
792             #XXX duplicated from properties_texture.py
793
794             wide_ui = context.region.width > narrowui
795
796
797             col.separator()
798
799
800             col.label(text="Brush Mapping:")
801             row = col.row(align=True)
802             row.prop(tex_slot, "map_mode", expand=True)
803
804             col.separator()
805
806             col = layout.column()
807             col.active = tex_slot.map_mode in ('FIXED')
808             col.label(text="Angle:")
809             
810             col = layout.column()
811             if not brush.use_anchor and brush.sculpt_tool not in ('GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE') and tex_slot.map_mode in ('FIXED'):
812                 col.prop(brush, "texture_angle_source", text="")
813             else:
814                 col.prop(brush, "texture_angle_source_no_random", text="")
815
816             #row = col.row(align=True)
817             #row.label(text="Angle:")
818             #row.active = tex_slot.map_mode in ('FIXED', 'TILED')
819
820             #row = col.row(align=True)
821
822             #col = row.column()
823             #col.active = tex_slot.map_mode in ('FIXED')
824             #col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
825
826             col = layout.column()
827             col.prop(tex_slot, "angle", text="")
828             col.active = tex_slot.map_mode in ('FIXED', 'TILED')
829
830             #col = layout.column()
831             #col.prop(brush, "use_random_rotation")
832             #col.active = (not brush.use_rake) and (not brush.use_anchor) and brush.sculpt_tool not in ('GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE') and tex_slot.map_mode in ('FIXED')
833
834             split = layout.split()
835
836             col = split.column()
837             col.prop(tex_slot, "offset")
838
839             if wide_ui:
840                 col = split.column()
841             else:
842                 col.separator()
843
844             col.prop(tex_slot, "size")
845
846             col = layout.column()
847
848             row = col.row(align=True)
849             row.label(text="Sample Bias:")
850             row = col.row(align=True)
851             row.prop(brush, "texture_sample_bias", slider=True, text="")
852
853             row = col.row(align=True)
854             row.label(text="Overlay:")
855             row.active = tex_slot.map_mode in ('FIXED', 'TILED')
856
857             row = col.row(align=True)
858
859             col = row.column()
860
861             if brush.use_texture_overlay:
862                 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_OFF')
863             else:
864                 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_ON')
865
866             col.active = tex_slot.map_mode in ('FIXED', 'TILED')
867
868             col = row.column()
869             col.prop(brush, "texture_overlay_alpha", text="Alpha")
870             col.active = tex_slot.map_mode in ('FIXED', 'TILED') and brush.use_texture_overlay
871
872
873 class VIEW3D_PT_tools_brush_tool(PaintPanel):
874     bl_label = "Tool"
875     bl_default_closed = True
876
877     def poll(self, context):
878         settings = self.paint_settings(context)
879         return (settings and settings.brush and
880             (context.sculpt_object or context.texture_paint_object or
881             context.vertex_paint_object or context.weight_paint_object))
882
883     def draw(self, context):
884         layout = self.layout
885
886         settings = self.paint_settings(context)
887         brush = settings.brush
888         texture_paint = context.texture_paint_object
889         sculpt = context.sculpt_object
890
891         col = layout.column(align=True)
892
893         if context.sculpt_object:
894             col.prop(brush, "sculpt_tool", expand=False, text="")
895         elif context.texture_paint_object:
896             col.prop(brush, "imagepaint_tool", expand=False, text="")
897         elif context.vertex_paint_object or context.weight_paint_object:
898             col.prop(brush, "vertexpaint_tool", expand=False, text="")
899
900
901 class VIEW3D_PT_tools_brush_stroke(PaintPanel):
902     bl_label = "Stroke"
903     bl_default_closed = True
904
905     def poll(self, context):
906         settings = self.paint_settings(context)
907         return (settings and settings.brush and (context.sculpt_object or
908                              context.vertex_paint_object or
909                              context.weight_paint_object or
910                              context.texture_paint_object))
911
912     def draw(self, context):
913         layout = self.layout
914
915         settings = self.paint_settings(context)
916         brush = settings.brush
917         texture_paint = context.texture_paint_object
918
919         col = layout.column()
920
921         if context.sculpt_object:
922             col.label(text="Stroke Method:")
923             col.prop(brush, "stroke_method", text="")
924
925             if brush.use_anchor:
926                 col.separator()
927                 row = col.row()
928                 row.prop(brush, "edge_to_edge", "Edge To Edge")
929
930             if brush.use_airbrush:
931                 col.separator()
932                 row = col.row()
933                 row.prop(brush, "rate", text="Rate", slider=True)
934
935             if brush.use_space:
936                 col.separator()
937                 row = col.row()
938                 row.active = brush.use_space
939                 row.prop(brush, "spacing", text="Spacing")
940
941             if brush.sculpt_tool not in ('GRAB', 'THUMB', 'SNAKE_HOOK', 'ROTATE') and (not brush.use_anchor) and (not brush.restore_mesh):
942                 col = layout.column()
943                 col.separator()
944
945                 col.prop(brush, "use_smooth_stroke")
946
947                 sub = col.column()
948                 sub.active = brush.use_smooth_stroke
949                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
950                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
951
952                 col.separator()
953
954                 row = col.row(align=True)
955                 row.prop(brush, "jitter", slider=True)
956                 row.prop(brush, "use_jitter_pressure", toggle=True, text="")
957
958         else:
959             row = col.row()
960             row.prop(brush, "use_airbrush")
961
962             row = col.row()
963             row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
964             row.prop(brush, "rate", slider=True)
965
966             col.separator()
967
968             if not texture_paint:
969                 row = col.row()
970                 row.prop(brush, "use_smooth_stroke")
971
972                 col = layout.column()
973                 col.active = brush.use_smooth_stroke
974                 col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
975                 col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
976
977             col.separator()
978
979             col = layout.column()
980             col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'))
981
982             row = col.row()
983             row.prop(brush, "use_space")
984
985             row = col.row()
986             row.active = brush.use_space
987             row.prop(brush, "spacing", text="Spacing")
988
989             #col.prop(brush, "use_space_atten", text="Adaptive Strength")
990             #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
991
992             #col.separator()
993
994             #if texture_paint:
995             #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
996
997
998 class VIEW3D_PT_tools_brush_curve(PaintPanel):
999     bl_label = "Curve"
1000     bl_default_closed = True
1001
1002     def poll(self, context):
1003         settings = self.paint_settings(context)
1004         return (settings and settings.brush and settings.brush.curve)
1005
1006     def draw(self, context):
1007         layout = self.layout
1008
1009         settings = self.paint_settings(context)
1010         brush = settings.brush
1011
1012         layout.template_curve_mapping(brush, "curve", brush=True)
1013
1014         row = layout.row(align=True)
1015         row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
1016         row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
1017         row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
1018         row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
1019         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
1020         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
1021         row.operator("brush.curve_preset", icon="RNDCURVE", text="").shape = 'MID9'
1022
1023 class VIEW3D_PT_sculpt_options(PaintPanel):
1024     bl_label = "Options"
1025     bl_default_closed = True
1026
1027     def poll(self, context):
1028         return (context.sculpt_object and context.tool_settings.sculpt)
1029
1030     def draw(self, context):
1031         layout = self.layout
1032
1033         wide_ui = context.region.width > narrowui
1034
1035         sculpt = context.tool_settings.sculpt
1036         settings = self.paint_settings(context)
1037         brush = settings.brush
1038
1039         split = layout.split()
1040
1041         col = split.column()
1042
1043         edit = context.user_preferences.edit
1044         col.label(text="Unified Settings:")
1045         col.prop(edit, "sculpt_paint_use_unified_size", text="Size")
1046         col.prop(edit, "sculpt_paint_use_unified_strength", text="Strength")
1047
1048         if wide_ui:
1049             col = split.column()
1050         else:
1051             col.separator()
1052
1053         col.label(text="Lock:")
1054         row = col.row(align=True)
1055         row.prop(sculpt, "lock_x", text="X", toggle=True)
1056         row.prop(sculpt, "lock_y", text="Y", toggle=True)
1057         row.prop(sculpt, "lock_z", text="Z", toggle=True)
1058
1059 class VIEW3D_PT_sculpt_symmetry(PaintPanel):
1060     bl_label = "Symmetry"
1061     bl_default_closed = True
1062
1063     def poll(self, context):
1064         return (context.sculpt_object and context.tool_settings.sculpt)
1065
1066     def draw(self, context):
1067         wide_ui = context.region.width > narrowui
1068
1069         layout = self.layout
1070
1071         sculpt = context.tool_settings.sculpt
1072         settings = self.paint_settings(context)
1073         brush = settings.brush
1074
1075         split = layout.split()
1076
1077         col = split.column()
1078
1079         col.label(text="Mirror:")
1080         col.prop(sculpt, "symmetry_x", text="X")
1081         col.prop(sculpt, "symmetry_y", text="Y")
1082         col.prop(sculpt, "symmetry_z", text="Z")
1083
1084         if wide_ui:
1085             col = split.column()
1086         else:
1087             col.separator()
1088
1089         col.prop(sculpt, "radial_symm", text="Radial")
1090
1091         col = layout.column()
1092
1093         col.separator()
1094
1095         col.prop(sculpt, "use_symmetry_feather", text="Feather")
1096
1097 class VIEW3D_PT_tools_brush_appearance(PaintPanel):
1098     bl_label = "Appearance"
1099     bl_default_closed = True
1100
1101     def poll(self, context):
1102         return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.texture_paint_object and context.tool_settings.image_paint)
1103
1104     def draw(self, context):
1105         layout = self.layout
1106
1107         sculpt = context.tool_settings.sculpt
1108         settings = self.paint_settings(context)
1109         brush = settings.brush
1110
1111         col = layout.column();
1112
1113         if context.sculpt_object and context.tool_settings.sculpt:
1114             #if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'CLAY_TUBES', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
1115             if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
1116                 col.prop(brush, "add_col", text="Add Color")
1117                 col.prop(brush, "sub_col", text="Subtract Color")
1118             else:
1119                 col.prop(brush, "add_col", text="Color")
1120
1121         col.separator()
1122
1123         col = layout.column()
1124         col.label(text="Icon:")
1125
1126         row = col.row(align=True)
1127         row.prop(brush, "icon", text="")
1128
1129         row = col.row(align=True)
1130         row.prop(brush, "icon_filepath", text="")
1131
1132 # ********** default tools for weightpaint ****************
1133
1134
1135 class VIEW3D_PT_tools_weightpaint(View3DPanel):
1136     bl_context = "weightpaint"
1137     bl_label = "Weight Tools"
1138
1139     def draw(self, context):
1140         layout = self.layout
1141
1142         col = layout.column()
1143         col.operator("object.vertex_group_normalize_all", text="Normalize All")
1144         col.operator("object.vertex_group_normalize", text="Normalize")
1145         col.operator("object.vertex_group_invert", text="Invert")
1146         col.operator("object.vertex_group_clean", text="Clean")
1147         col.operator("object.vertex_group_levels", text="Levels")
1148
1149
1150 class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
1151     bl_context = "weightpaint"
1152     bl_label = "Options"
1153
1154     def draw(self, context):
1155         layout = self.layout
1156
1157         wpaint = context.tool_settings.weight_paint
1158
1159         col = layout.column()
1160         col.prop(wpaint, "all_faces")
1161         col.prop(wpaint, "normals")
1162         col.prop(wpaint, "spray")
1163
1164         obj = context.weight_paint_object
1165         if obj.type == 'MESH':
1166             mesh = obj.data
1167             col.prop(mesh, "use_mirror_x")
1168             col.prop(mesh, "use_mirror_topology")
1169
1170 # Commented out because the Apply button isn't an operator yet, making these settings useless
1171 #               col.label(text="Gamma:")
1172 #               col.prop(wpaint, "gamma", text="")
1173 #               col.label(text="Multiply:")
1174 #               col.prop(wpaint, "mul", text="")
1175
1176 # Also missing now:
1177 # Soft, Vgroup, X-Mirror and "Clear" Operator.
1178
1179 # ********** default tools for vertexpaint ****************
1180
1181
1182 class VIEW3D_PT_tools_vertexpaint(View3DPanel):
1183     bl_context = "vertexpaint"
1184     bl_label = "Options"
1185
1186     def draw(self, context):
1187         layout = self.layout
1188
1189         vpaint = context.tool_settings.vertex_paint
1190
1191         col = layout.column()
1192         #col.prop(vpaint, "mode", text="")
1193         col.prop(vpaint, "all_faces")
1194         col.prop(vpaint, "normals")
1195         col.prop(vpaint, "spray")
1196
1197 # Commented out because the Apply button isn't an operator yet, making these settings useless
1198 #               col.label(text="Gamma:")
1199 #               col.prop(vpaint, "gamma", text="")
1200 #               col.label(text="Multiply:")
1201 #               col.prop(vpaint, "mul", text="")
1202
1203 # ********** default tools for texturepaint ****************
1204
1205
1206 class VIEW3D_PT_tools_projectpaint(View3DPanel):
1207     bl_context = "texturepaint"
1208     bl_label = "Project Paint"
1209
1210     def poll(self, context):
1211         return context.tool_settings.image_paint.brush.imagepaint_tool != 'SMEAR'
1212
1213     def draw_header(self, context):
1214         ipaint = context.tool_settings.image_paint
1215
1216         self.layout.prop(ipaint, "use_projection", text="")
1217
1218     def draw(self, context):
1219         layout = self.layout
1220
1221         ipaint = context.tool_settings.image_paint
1222         settings = context.tool_settings.image_paint
1223         use_projection = ipaint.use_projection
1224
1225         col = layout.column()
1226         sub = col.column()
1227         sub.active = use_projection
1228         sub.prop(ipaint, "use_occlude")
1229         sub.prop(ipaint, "use_backface_cull")
1230
1231         split = layout.split()
1232
1233         col = split.column()
1234         col.active = (use_projection)
1235         col.prop(ipaint, "use_normal_falloff")
1236
1237         col = split.column()
1238         col.active = (ipaint.use_normal_falloff and use_projection)
1239         col.prop(ipaint, "normal_angle", text="")
1240
1241         col = layout.column(align=False)
1242         row = col.row()
1243         row.active = (use_projection)
1244         row.prop(ipaint, "use_stencil_layer", text="Stencil")
1245
1246         row2 = row.row(align=False)
1247         row2.active = (use_projection and ipaint.use_stencil_layer)
1248         row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=context.active_object.data.uv_texture_stencil.name)
1249         row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
1250
1251         col = layout.column()
1252         sub = col.column()
1253         row = sub.row()
1254         row.active = (settings.brush.imagepaint_tool == 'CLONE')
1255
1256         row.prop(ipaint, "use_clone_layer", text="Layer")
1257         row.menu("VIEW3D_MT_tools_projectpaint_clone", text=context.active_object.data.uv_texture_clone.name)
1258
1259         sub = col.column()
1260         sub.prop(ipaint, "seam_bleed")
1261
1262         col.label(text="External Editing")
1263         row = col.split(align=True, percentage=0.55)
1264         row.operator("image.project_edit", text="Quick Edit")
1265         row.operator("image.project_apply", text="Apply")
1266         row = col.row(align=True)
1267         row.prop(ipaint, "screen_grab_size", text="")
1268
1269         sub = col.column()
1270         sub.operator("paint.project_image", text="Apply Camera Image")
1271
1272         sub.operator("image.save_dirty", text="Save All Edited")
1273
1274
1275 class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
1276     bl_label = "Clone Layer"
1277
1278     def draw(self, context):
1279         layout = self.layout
1280         for i, tex in enumerate(context.active_object.data.uv_textures):
1281             prop = layout.operator("wm.context_set_int", text=tex.name)
1282             prop.data_path = "active_object.data.uv_texture_clone_index"
1283             prop.value = i
1284
1285
1286 class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
1287     bl_label = "Mask Layer"
1288
1289     def draw(self, context):
1290         layout = self.layout
1291         for i, tex in enumerate(context.active_object.data.uv_textures):
1292             prop = layout.operator("wm.context_set_int", text=tex.name)
1293             prop.data_path = "active_object.data.uv_texture_stencil_index"
1294             prop.value = i
1295
1296
1297 class VIEW3D_PT_tools_particlemode(View3DPanel):
1298     '''default tools for particle mode'''
1299     bl_context = "particlemode"
1300     bl_label = "Options"
1301
1302     def draw(self, context):
1303         layout = self.layout
1304
1305         pe = context.tool_settings.particle_edit
1306         ob = pe.object
1307
1308         layout.prop(pe, "type", text="")
1309
1310         ptcache = None
1311
1312         if pe.type == 'PARTICLES':
1313             if ob.particle_systems:
1314                 if len(ob.particle_systems) > 1:
1315                     layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
1316
1317                 ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
1318         else:
1319             for md in ob.modifiers:
1320                 if md.type == pe.type:
1321                     ptcache = md.point_cache
1322
1323         if ptcache and len(ptcache.point_cache_list) > 1:
1324             layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS')
1325
1326
1327         if not pe.editable:
1328             layout.label(text="Point cache must be baked")
1329             layout.label(text="to enable editing!")
1330
1331         col = layout.column(align=True)
1332         if pe.hair:
1333             col.active = pe.editable
1334             col.prop(pe, "emitter_deflect", text="Deflect emitter")
1335             sub = col.row()
1336             sub.active = pe.emitter_deflect
1337             sub.prop(pe, "emitter_distance", text="Distance")
1338
1339         col = layout.column(align=True)
1340         col.active = pe.editable
1341         col.label(text="Keep:")
1342         col.prop(pe, "keep_lengths", text="Lenghts")
1343         col.prop(pe, "keep_root", text="Root")
1344         if not pe.hair:
1345             col.label(text="Correct:")
1346             col.prop(pe, "auto_velocity", text="Velocity")
1347         col.prop(ob.data, "use_mirror_x")
1348
1349         col = layout.column(align=True)
1350         col.active = pe.editable
1351         col.label(text="Draw:")
1352         col.prop(pe, "draw_step", text="Path Steps")
1353         if pe.hair:
1354             col.prop(pe, "draw_particles", text="Children")
1355         else:
1356             if pe.type == 'PARTICLES':
1357                 col.prop(pe, "draw_particles", text="Particles")
1358             col.prop(pe, "fade_time")
1359             sub = col.row()
1360             sub.active = pe.fade_time
1361             sub.prop(pe, "fade_frames", slider=True)
1362
1363
1364 classes = [
1365     VIEW3D_PT_tools_weightpaint,
1366     VIEW3D_PT_tools_objectmode,
1367     VIEW3D_PT_tools_meshedit,
1368     VIEW3D_PT_tools_meshedit_options,
1369     VIEW3D_PT_tools_curveedit,
1370     VIEW3D_PT_tools_surfaceedit,
1371     VIEW3D_PT_tools_textedit,
1372     VIEW3D_PT_tools_armatureedit,
1373     VIEW3D_PT_tools_armatureedit_options,
1374     VIEW3D_PT_tools_mballedit,
1375     VIEW3D_PT_tools_latticeedit,
1376     VIEW3D_PT_tools_posemode,
1377     VIEW3D_PT_tools_posemode_options,
1378     VIEW3D_PT_tools_brush,
1379     VIEW3D_PT_tools_brush_texture,
1380     VIEW3D_PT_tools_brush_stroke,
1381     VIEW3D_PT_tools_brush_curve,
1382     VIEW3D_PT_tools_brush_appearance,
1383     VIEW3D_PT_tools_brush_tool,
1384     VIEW3D_PT_sculpt_symmetry,
1385     VIEW3D_PT_sculpt_options,
1386     VIEW3D_PT_tools_vertexpaint,
1387     VIEW3D_PT_tools_weightpaint_options,
1388
1389     VIEW3D_PT_tools_projectpaint,
1390     VIEW3D_MT_tools_projectpaint_clone,
1391     VIEW3D_MT_tools_projectpaint_stencil,
1392
1393     VIEW3D_PT_tools_particlemode]
1394
1395
1396 def register():
1397     register = bpy.types.register
1398     for cls in classes:
1399         register(cls)
1400
1401
1402 def unregister():
1403     unregister = bpy.types.unregister
1404     for cls in classes:
1405         unregister(cls)
1406
1407 if __name__ == "__main__":
1408     register()