svn merge -r 30566:30717 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[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
559             col = layout.column()
560
561
562             col.separator()
563
564             row = col.row(align=True)
565
566             if brush.use_locked_size:
567                 row.prop(brush, "use_locked_size", toggle=True, text="", icon='LOCKED')
568                 row.prop(brush, "unprojected_radius", text="Radius", slider=True)
569             else:
570                 row.prop(brush, "use_locked_size", toggle=True, text="", icon='UNLOCKED')
571                 row.prop(brush, "size", text="Radius", slider=True)
572
573             row.prop(brush, "use_size_pressure", toggle=True, text="")
574
575
576             if brush.sculpt_tool not in ('SNAKE_HOOK', 'GRAB', 'ROTATE'):
577                 col.separator()
578
579                 row = col.row(align=True)
580
581                 if brush.use_space and brush.sculpt_tool not in ('SMOOTH'):
582                     if brush.use_space_atten:
583                         row.prop(brush, "use_space_atten", toggle=True, text="", icon='LOCKED')
584                     else:
585                         row.prop(brush, "use_space_atten", toggle=True, text="", icon='UNLOCKED')
586
587                 row.prop(brush, "strength", text="Strength", slider=True)
588                 row.prop(brush, "use_strength_pressure", text="")
589
590
591
592             if brush.sculpt_tool not in ('SMOOTH'):
593                 col.separator()
594
595                 row = col.row(align=True)
596                 row.prop(brush, "autosmooth_factor", slider=True)
597                 row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
598
599
600
601             if brush.sculpt_tool in ('GRAB', 'SNAKE_HOOK'):
602                 col.separator()
603
604                 row = col.row(align=True)
605                 row.prop(brush, "normal_weight", slider=True)
606
607
608
609             if brush.sculpt_tool in ('CREASE', 'BLOB'):
610                 col.separator()
611
612                 row = col.row(align=True)
613                 row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
614
615             if brush.sculpt_tool not in ('PINCH', 'INFLATE', 'SMOOTH'):
616                 row = col.row(align=True)
617
618                 col.separator()
619
620                 if brush.use_original_normal:
621                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
622                 else:
623                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
624
625                 row.prop(brush, "sculpt_plane", text="")
626
627             #if brush.sculpt_tool in ('CLAY', 'CLAY_TUBES', 'FLATTEN', 'FILL', 'SCRAPE'):
628             if brush.sculpt_tool in ('CLAY', 'FLATTEN', 'FILL', 'SCRAPE'):
629                 row = col.row(align=True)
630                 row.prop(brush, "plane_offset", slider=True)
631                 row.prop(brush, "use_offset_pressure", text="")
632
633                 col.separator()
634
635                 row= col.row()
636                 row.prop(brush, "use_plane_trim", text="Trim")
637                 row= col.row()
638                 row.active=brush.use_plane_trim
639                 row.prop(brush, "plane_trim", slider=True, text="Distance")
640
641             col.separator()
642
643             row= col.row()
644             row.prop(brush, "use_frontface", text="Front Faces Only")
645
646             #if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'LAYER', 'CLAY', 'CLAY_TUBES'):
647             if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'LAYER', 'CLAY'):
648                 col.separator()
649                 col.row().prop(brush, "direction", expand=True)
650             elif brush.sculpt_tool in ('FLATTEN'):
651                 col.separator()
652                 col.row().prop(brush, "flatten_contrast", expand=True)
653             elif brush.sculpt_tool in ('FILL'):
654                 col.separator()
655                 col.row().prop(brush, "fill_deepen", expand=True)
656             elif brush.sculpt_tool in ('SCRAPE'):
657                 col.separator()
658                 col.row().prop(brush, "scrape_peaks", expand=True)
659             elif brush.sculpt_tool in ('INFLATE'):
660                 col.separator()
661                 col.row().prop(brush, "inflate_deflate", expand=True)
662             elif brush.sculpt_tool in ('PINCH'):
663                 col.separator()
664                 col.row().prop(brush, "pinch_magnify", expand=True)
665
666
667
668             #if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY', 'CLAY_TUBES'):
669             if brush.sculpt_tool in ('DRAW', 'CREASE', 'BLOB', 'INFLATE', 'LAYER', 'CLAY'):
670                 col.separator()
671
672                 col.prop(brush, "use_accumulate")
673
674
675
676             if brush.sculpt_tool == 'LAYER':
677                 col.separator()
678
679                 ob = context.sculpt_object
680                 do_persistent = True
681
682                 # not supported yet for this case
683                 for md in ob.modifiers:
684                     if md.type == 'MULTIRES':
685                         do_persistent = False
686
687                 if do_persistent:
688                     col.prop(brush, "use_persistent")
689                     col.operator("sculpt.set_persistent_base")
690
691         # Texture Paint Mode #
692
693         elif context.texture_paint_object and brush:
694             col = layout.column()
695             col.template_color_wheel(brush, "color", value_slider=True)
696             col.prop(brush, "color", text="")
697
698             row = col.row(align=True)
699             row.prop(brush, "size", text="Radius", slider=True)
700             row.prop(brush, "use_size_pressure", toggle=True, text="")
701
702             row = col.row(align=True)
703             row.prop(brush, "strength", text="Strength", slider=True)
704             row.prop(brush, "use_strength_pressure", toggle=True, text="")
705
706             row = col.row(align=True)
707             row.prop(brush, "jitter", slider=True)
708             row.prop(brush, "use_jitter_pressure", toggle=True, text="")
709
710             col.prop(brush, "blend", text="Blend")
711
712             col = layout.column()
713             col.active = (brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'))
714             col.prop(brush, "use_alpha")
715
716
717         # Weight Paint Mode #
718
719         elif context.weight_paint_object and brush:
720             layout.prop(context.tool_settings, "vertex_group_weight", text="Weight", slider=True)
721             layout.prop(context.tool_settings, "auto_normalize", text="Auto Normalize")
722
723             col = layout.column()
724
725             row = col.row(align=True)
726             row.prop(brush, "size", text="Radius", slider=True)
727             row.prop(brush, "use_size_pressure", toggle=True, text="")
728
729             row = col.row(align=True)
730             row.prop(brush, "strength", text="Strength", slider=True)
731             row.prop(brush, "use_strength_pressure", toggle=True, text="")
732
733             row = col.row(align=True)
734             row.prop(brush, "jitter", slider=True)
735             row.prop(brush, "use_jitter_pressure", toggle=True, text="")
736
737         # Vertex Paint Mode #
738
739         elif context.vertex_paint_object and brush:
740             col = layout.column()
741             col.template_color_wheel(brush, "color", value_slider=True)
742             col.prop(brush, "color", text="")
743
744             row = col.row(align=True)
745             row.prop(brush, "size", text="Radius", slider=True)
746             row.prop(brush, "use_size_pressure", toggle=True, text="")
747
748             row = col.row(align=True)
749             row.prop(brush, "strength", text="Strength", slider=True)
750             row.prop(brush, "use_strength_pressure", toggle=True, text="")
751
752             # XXX - TODO
753             #row = col.row(align=True)
754             #row.prop(brush, "jitter", slider=True)
755             #row.prop(brush, "use_jitter_pressure", toggle=True, text="")
756
757
758 class VIEW3D_PT_tools_brush_texture(PaintPanel):
759     bl_label = "Texture"
760     bl_default_closed = True
761
762     def poll(self, context):
763         settings = self.paint_settings(context)
764         return (settings and settings.brush and (context.sculpt_object or
765                              context.texture_paint_object))
766
767     def draw(self, context):
768         layout = self.layout
769
770         settings = self.paint_settings(context)
771         brush = settings.brush
772         tex_slot = brush.texture_slot
773
774         col = layout.column()
775
776         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
777
778         if context.sculpt_object:
779             #XXX duplicated from properties_texture.py
780
781             wide_ui = context.region.width > narrowui
782
783
784             col.separator()
785
786
787             col.label(text="Brush Mapping:")
788             row = col.row(align=True)
789             row.prop(tex_slot, "map_mode", expand=True)
790
791             col.separator()
792
793             col = layout.column()
794             col.active = tex_slot.map_mode in ('FIXED')
795             col.label(text="Angle:")
796             
797             col = layout.column()
798             if not brush.use_anchor and brush.sculpt_tool not in ('GRAB', 'SNAKE_HOOK', 'THUMB', 'ROTATE') and tex_slot.map_mode in ('FIXED'):
799                 col.prop(brush, "texture_angle_source", text="")
800             else:
801                 col.prop(brush, "texture_angle_source_no_random", text="")
802
803             #row = col.row(align=True)
804             #row.label(text="Angle:")
805             #row.active = tex_slot.map_mode in ('FIXED', 'TILED')
806
807             #row = col.row(align=True)
808
809             #col = row.column()
810             #col.active = tex_slot.map_mode in ('FIXED')
811             #col.prop(brush, "use_rake", toggle=True, icon='PARTICLEMODE', text="")
812
813             col = layout.column()
814             col.prop(tex_slot, "angle", text="")
815             col.active = tex_slot.map_mode in ('FIXED', 'TILED')
816
817             #col = layout.column()
818             #col.prop(brush, "use_random_rotation")
819             #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')
820
821             split = layout.split()
822
823             col = split.column()
824             col.prop(tex_slot, "offset")
825
826             if wide_ui:
827                 col = split.column()
828             else:
829                 col.separator()
830
831             col.prop(tex_slot, "size")
832
833             col = layout.column()
834
835             row = col.row(align=True)
836             row.label(text="Sample Bias:")
837             row = col.row(align=True)
838             row.prop(brush, "texture_sample_bias", slider=True, text="")
839
840             row = col.row(align=True)
841             row.label(text="Overlay:")
842             row.active = tex_slot.map_mode in ('FIXED', 'TILED')
843
844             row = col.row(align=True)
845
846             col = row.column()
847
848             if brush.use_texture_overlay:
849                 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_OFF')
850             else:
851                 col.prop(brush, "use_texture_overlay", toggle=True, text="", icon='MUTE_IPO_ON')
852
853             col.active = tex_slot.map_mode in ('FIXED', 'TILED')
854
855             col = row.column()
856             col.prop(brush, "texture_overlay_alpha", text="Alpha")
857             col.active = tex_slot.map_mode in ('FIXED', 'TILED') and brush.use_texture_overlay
858
859
860 class VIEW3D_PT_tools_brush_tool(PaintPanel):
861     bl_label = "Tool"
862     bl_default_closed = True
863
864     def poll(self, context):
865         settings = self.paint_settings(context)
866         return (settings and settings.brush and
867             (context.sculpt_object or context.texture_paint_object or
868             context.vertex_paint_object or context.weight_paint_object))
869
870     def draw(self, context):
871         layout = self.layout
872
873         settings = self.paint_settings(context)
874         brush = settings.brush
875         texture_paint = context.texture_paint_object
876         sculpt = context.sculpt_object
877
878         col = layout.column(align=True)
879
880         if context.sculpt_object:
881             col.prop(brush, "sculpt_tool", expand=False, text="")
882         elif context.texture_paint_object:
883             col.prop(brush, "imagepaint_tool", expand=False, text="")
884         elif context.vertex_paint_object or context.weight_paint_object:
885             col.prop(brush, "vertexpaint_tool", expand=False, text="")
886
887
888 class VIEW3D_PT_tools_brush_stroke(PaintPanel):
889     bl_label = "Stroke"
890     bl_default_closed = True
891
892     def poll(self, context):
893         settings = self.paint_settings(context)
894         return (settings and settings.brush and (context.sculpt_object or
895                              context.vertex_paint_object or
896                              context.weight_paint_object or
897                              context.texture_paint_object))
898
899     def draw(self, context):
900         layout = self.layout
901
902         settings = self.paint_settings(context)
903         brush = settings.brush
904         texture_paint = context.texture_paint_object
905
906         col = layout.column()
907
908         if context.sculpt_object:
909             col.label(text="Stroke Method:")
910             col.prop(brush, "stroke_method", text="")
911
912             if brush.use_anchor:
913                 col.separator()
914                 row = col.row()
915                 row.prop(brush, "edge_to_edge", "Edge To Edge")
916
917             if brush.use_airbrush:
918                 col.separator()
919                 row = col.row()
920                 row.prop(brush, "rate", text="Rate", slider=True)
921
922             if brush.use_space:
923                 col.separator()
924                 row = col.row()
925                 row.active = brush.use_space
926                 row.prop(brush, "spacing", text="Spacing")
927
928             if brush.sculpt_tool not in ('GRAB', 'THUMB', 'SNAKE_HOOK', 'ROTATE') and (not brush.use_anchor) and (not brush.restore_mesh):
929                 col = layout.column()
930                 col.separator()
931
932                 col.prop(brush, "use_smooth_stroke")
933
934                 sub = col.column()
935                 sub.active = brush.use_smooth_stroke
936                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
937                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
938
939                 col.separator()
940
941                 row = col.row(align=True)
942                 row.prop(brush, "jitter", slider=True)
943                 row.prop(brush, "use_jitter_pressure", toggle=True, text="")
944
945         else:
946             row = col.row()
947             row.prop(brush, "use_airbrush")
948
949             row = col.row()
950             row.active = brush.use_airbrush and (not brush.use_space) and (not brush.use_anchor)
951             row.prop(brush, "rate", slider=True)
952
953             col.separator()
954
955             if not texture_paint:
956                 row = col.row()
957                 row.prop(brush, "use_smooth_stroke")
958
959                 col = layout.column()
960                 col.active = brush.use_smooth_stroke
961                 col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
962                 col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
963
964             col.separator()
965
966             col = layout.column()
967             col.active = (not brush.use_anchor) and (brush.sculpt_tool not in ('GRAB', 'THUMB', 'ROTATE', 'SNAKE_HOOK'))
968
969             row = col.row()
970             row.prop(brush, "use_space")
971
972             row = col.row()
973             row.active = brush.use_space
974             row.prop(brush, "spacing", text="Spacing")
975
976             #col.prop(brush, "use_space_atten", text="Adaptive Strength")
977             #col.prop(brush, "use_adaptive_space", text="Adaptive Spacing")
978
979             #col.separator()
980
981             #if texture_paint:
982             #    row.prop(brush, "use_spacing_pressure", toggle=True, text="")
983
984
985 class VIEW3D_PT_tools_brush_curve(PaintPanel):
986     bl_label = "Curve"
987     bl_default_closed = True
988
989     def poll(self, context):
990         settings = self.paint_settings(context)
991         return (settings and settings.brush and settings.brush.curve)
992
993     def draw(self, context):
994         layout = self.layout
995
996         settings = self.paint_settings(context)
997         brush = settings.brush
998
999         layout.template_curve_mapping(brush, "curve", brush=True)
1000
1001         row = layout.row(align=True)
1002         row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
1003         row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
1004         row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
1005         row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
1006         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
1007         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
1008         row.operator("brush.curve_preset", icon="RNDCURVE", text="").shape = 'MID9'
1009
1010 class VIEW3D_PT_sculpt_options(PaintPanel):
1011     bl_label = "Options"
1012     bl_default_closed = True
1013
1014     def poll(self, context):
1015         return (context.sculpt_object and context.tool_settings.sculpt)
1016
1017     def draw(self, context):
1018         layout = self.layout
1019
1020         wide_ui = context.region.width > narrowui
1021
1022         tool_settings = context.tool_settings
1023         sculpt = tool_settings.sculpt
1024         settings = self.paint_settings(context)
1025         brush = settings.brush
1026
1027         split = layout.split()
1028
1029         col = split.column()
1030
1031         col.label(text="Unified Settings:")
1032         col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1033         col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1034
1035         if wide_ui:
1036             col = split.column()
1037         else:
1038             col.separator()
1039
1040         col.label(text="Lock:")
1041         row = col.row(align=True)
1042         row.prop(sculpt, "lock_x", text="X", toggle=True)
1043         row.prop(sculpt, "lock_y", text="Y", toggle=True)
1044         row.prop(sculpt, "lock_z", text="Z", toggle=True)
1045
1046 class VIEW3D_PT_sculpt_symmetry(PaintPanel):
1047     bl_label = "Symmetry"
1048     bl_default_closed = True
1049
1050     def poll(self, context):
1051         return (context.sculpt_object and context.tool_settings.sculpt)
1052
1053     def draw(self, context):
1054         wide_ui = context.region.width > narrowui
1055
1056         layout = self.layout
1057
1058         sculpt = context.tool_settings.sculpt
1059         settings = self.paint_settings(context)
1060         brush = settings.brush
1061
1062         split = layout.split()
1063
1064         col = split.column()
1065
1066         col.label(text="Mirror:")
1067         col.prop(sculpt, "symmetry_x", text="X")
1068         col.prop(sculpt, "symmetry_y", text="Y")
1069         col.prop(sculpt, "symmetry_z", text="Z")
1070
1071         if wide_ui:
1072             col = split.column()
1073         else:
1074             col.separator()
1075
1076         col.prop(sculpt, "radial_symm", text="Radial")
1077
1078         col = layout.column()
1079
1080         col.separator()
1081
1082         col.prop(sculpt, "use_symmetry_feather", text="Feather")
1083
1084 class VIEW3D_PT_tools_brush_appearance(PaintPanel):
1085     bl_label = "Appearance"
1086     bl_default_closed = True
1087
1088     def poll(self, context):
1089         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)
1090
1091     def draw(self, context):
1092         layout = self.layout
1093
1094         sculpt = context.tool_settings.sculpt
1095         settings = self.paint_settings(context)
1096         brush = settings.brush
1097
1098         col = layout.column();
1099
1100         if context.sculpt_object and context.tool_settings.sculpt:
1101             #if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE', 'CLAY_TUBES'):
1102             if brush.sculpt_tool in ('DRAW', 'INFLATE', 'CLAY', 'PINCH', 'CREASE', 'BLOB', 'FLATTEN', 'FILL', 'SCRAPE'):
1103                 col.prop(brush, "add_col", text="Add Color")
1104                 col.prop(brush, "sub_col", text="Subtract Color")
1105             else:
1106                 col.prop(brush, "add_col", text="Color")
1107         else:
1108             col.prop(brush, "add_col", text="Color")
1109
1110         col.separator()
1111
1112         col = layout.column()
1113         col.label(text="Icon:")
1114
1115         row = col.row(align=True)
1116         row.prop(brush, "icon", text="")
1117
1118         row = col.row(align=True)
1119         row.prop(brush, "icon_filepath", text="")
1120
1121 # ********** default tools for weightpaint ****************
1122
1123
1124 class VIEW3D_PT_tools_weightpaint(View3DPanel):
1125     bl_context = "weightpaint"
1126     bl_label = "Weight Tools"
1127
1128     def draw(self, context):
1129         layout = self.layout
1130
1131         col = layout.column()
1132         col.operator("object.vertex_group_normalize_all", text="Normalize All")
1133         col.operator("object.vertex_group_normalize", text="Normalize")
1134         col.operator("object.vertex_group_invert", text="Invert")
1135         col.operator("object.vertex_group_clean", text="Clean")
1136         col.operator("object.vertex_group_levels", text="Levels")
1137
1138
1139 class VIEW3D_PT_tools_weightpaint_options(View3DPanel):
1140     bl_context = "weightpaint"
1141     bl_label = "Options"
1142
1143     def draw(self, context):
1144         layout = self.layout
1145
1146         tool_settings = context.tool_settings
1147         wpaint = tool_settings.weight_paint
1148
1149         col = layout.column()
1150         col.prop(wpaint, "all_faces")
1151         col.prop(wpaint, "normals")
1152         col.prop(wpaint, "spray")
1153
1154         obj = context.weight_paint_object
1155         if obj.type == 'MESH':
1156             mesh = obj.data
1157             col.prop(mesh, "use_mirror_x")
1158             col.prop(mesh, "use_mirror_topology")
1159
1160         col.label(text="Unified Settings:")
1161         col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1162         col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1163
1164 # Commented out because the Apply button isn't an operator yet, making these settings useless
1165 #               col.label(text="Gamma:")
1166 #               col.prop(wpaint, "gamma", text="")
1167 #               col.label(text="Multiply:")
1168 #               col.prop(wpaint, "mul", text="")
1169
1170 # Also missing now:
1171 # Soft, Vgroup, X-Mirror and "Clear" Operator.
1172
1173 # ********** default tools for vertexpaint ****************
1174
1175
1176 class VIEW3D_PT_tools_vertexpaint(View3DPanel):
1177     bl_context = "vertexpaint"
1178     bl_label = "Options"
1179
1180     def draw(self, context):
1181         layout = self.layout
1182
1183         tool_settings = context.tool_settings
1184         vpaint = tool_settings.vertex_paint
1185
1186         col = layout.column()
1187         #col.prop(vpaint, "mode", text="")
1188         col.prop(vpaint, "all_faces")
1189         col.prop(vpaint, "normals")
1190         col.prop(vpaint, "spray")
1191
1192         col.label(text="Unified Settings:")
1193         col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1194         col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1195
1196 # Commented out because the Apply button isn't an operator yet, making these settings useless
1197 #               col.label(text="Gamma:")
1198 #               col.prop(vpaint, "gamma", text="")
1199 #               col.label(text="Multiply:")
1200 #               col.prop(vpaint, "mul", text="")
1201
1202 # ********** default tools for texturepaint ****************
1203
1204
1205 class VIEW3D_PT_tools_projectpaint(View3DPanel):
1206     bl_context = "texturepaint"
1207     bl_label = "Project Paint"
1208
1209     def poll(self, context):
1210         return context.tool_settings.image_paint.brush.imagepaint_tool != 'SMEAR'
1211
1212     def draw_header(self, context):
1213         ipaint = context.tool_settings.image_paint
1214
1215         self.layout.prop(ipaint, "use_projection", text="")
1216
1217     def draw(self, context):
1218         layout = self.layout
1219
1220         ipaint = context.tool_settings.image_paint
1221         settings = context.tool_settings.image_paint
1222         use_projection = ipaint.use_projection
1223
1224         col = layout.column()
1225         sub = col.column()
1226         sub.active = use_projection
1227         sub.prop(ipaint, "use_occlude")
1228         sub.prop(ipaint, "use_backface_cull")
1229
1230         split = layout.split()
1231
1232         col = split.column()
1233         col.active = (use_projection)
1234         col.prop(ipaint, "use_normal_falloff")
1235
1236         col = split.column()
1237         col.active = (ipaint.use_normal_falloff and use_projection)
1238         col.prop(ipaint, "normal_angle", text="")
1239
1240         col = layout.column(align=False)
1241         row = col.row()
1242         row.active = (use_projection)
1243         row.prop(ipaint, "use_stencil_layer", text="Stencil")
1244
1245         row2 = row.row(align=False)
1246         row2.active = (use_projection and ipaint.use_stencil_layer)
1247         row2.menu("VIEW3D_MT_tools_projectpaint_stencil", text=context.active_object.data.uv_texture_stencil.name)
1248         row2.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
1249
1250         col = layout.column()
1251         sub = col.column()
1252         row = sub.row()
1253         row.active = (settings.brush.imagepaint_tool == 'CLONE')
1254
1255         row.prop(ipaint, "use_clone_layer", text="Layer")
1256         row.menu("VIEW3D_MT_tools_projectpaint_clone", text=context.active_object.data.uv_texture_clone.name)
1257
1258         sub = col.column()
1259         sub.prop(ipaint, "seam_bleed")
1260
1261         col.label(text="External Editing")
1262         row = col.split(align=True, percentage=0.55)
1263         row.operator("image.project_edit", text="Quick Edit")
1264         row.operator("image.project_apply", text="Apply")
1265         row = col.row(align=True)
1266         row.prop(ipaint, "screen_grab_size", text="")
1267
1268         sub = col.column()
1269         sub.operator("paint.project_image", text="Apply Camera Image")
1270
1271         sub.operator("image.save_dirty", text="Save All Edited")
1272
1273
1274 class VIEW3D_PT_imagepaint_options(PaintPanel):
1275     bl_label = "Options"
1276     bl_default_closed = True
1277
1278     def poll(self, context):
1279         return (context.texture_paint_object and context.tool_settings.image_paint)
1280
1281     def draw(self, context):
1282         layout = self.layout
1283
1284         col = layout.column()
1285
1286         tool_settings = context.tool_settings
1287         col.label(text="Unified Settings:")
1288         col.prop(tool_settings, "sculpt_paint_use_unified_size", text="Size")
1289         col.prop(tool_settings, "sculpt_paint_use_unified_strength", text="Strength")
1290         
1291 class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
1292     bl_label = "Clone Layer"
1293
1294     def draw(self, context):
1295         layout = self.layout
1296         for i, tex in enumerate(context.active_object.data.uv_textures):
1297             prop = layout.operator("wm.context_set_int", text=tex.name)
1298             prop.data_path = "active_object.data.uv_texture_clone_index"
1299             prop.value = i
1300
1301
1302 class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
1303     bl_label = "Mask Layer"
1304
1305     def draw(self, context):
1306         layout = self.layout
1307         for i, tex in enumerate(context.active_object.data.uv_textures):
1308             prop = layout.operator("wm.context_set_int", text=tex.name)
1309             prop.data_path = "active_object.data.uv_texture_stencil_index"
1310             prop.value = i
1311
1312
1313 class VIEW3D_PT_tools_particlemode(View3DPanel):
1314     '''default tools for particle mode'''
1315     bl_context = "particlemode"
1316     bl_label = "Options"
1317
1318     def draw(self, context):
1319         layout = self.layout
1320
1321         pe = context.tool_settings.particle_edit
1322         ob = pe.object
1323
1324         layout.prop(pe, "type", text="")
1325
1326         ptcache = None
1327
1328         if pe.type == 'PARTICLES':
1329             if ob.particle_systems:
1330                 if len(ob.particle_systems) > 1:
1331                     layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
1332
1333                 ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
1334         else:
1335             for md in ob.modifiers:
1336                 if md.type == pe.type:
1337                     ptcache = md.point_cache
1338
1339         if ptcache and len(ptcache.point_cache_list) > 1:
1340             layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS')
1341
1342
1343         if not pe.editable:
1344             layout.label(text="Point cache must be baked")
1345             layout.label(text="to enable editing!")
1346
1347         col = layout.column(align=True)
1348         if pe.hair:
1349             col.active = pe.editable
1350             col.prop(pe, "emitter_deflect", text="Deflect emitter")
1351             sub = col.row()
1352             sub.active = pe.emitter_deflect
1353             sub.prop(pe, "emitter_distance", text="Distance")
1354
1355         col = layout.column(align=True)
1356         col.active = pe.editable
1357         col.label(text="Keep:")
1358         col.prop(pe, "keep_lengths", text="Lengths")
1359         col.prop(pe, "keep_root", text="Root")
1360         if not pe.hair:
1361             col.label(text="Correct:")
1362             col.prop(pe, "auto_velocity", text="Velocity")
1363         col.prop(ob.data, "use_mirror_x")
1364
1365         col = layout.column(align=True)
1366         col.active = pe.editable
1367         col.label(text="Draw:")
1368         col.prop(pe, "draw_step", text="Path Steps")
1369         if pe.hair:
1370             col.prop(pe, "draw_particles", text="Children")
1371         else:
1372             if pe.type == 'PARTICLES':
1373                 col.prop(pe, "draw_particles", text="Particles")
1374             col.prop(pe, "fade_time")
1375             sub = col.row()
1376             sub.active = pe.fade_time
1377             sub.prop(pe, "fade_frames", slider=True)
1378
1379
1380 classes = [
1381     VIEW3D_PT_tools_weightpaint,
1382     VIEW3D_PT_tools_objectmode,
1383     VIEW3D_PT_tools_meshedit,
1384     VIEW3D_PT_tools_meshedit_options,
1385     VIEW3D_PT_tools_curveedit,
1386     VIEW3D_PT_tools_surfaceedit,
1387     VIEW3D_PT_tools_textedit,
1388     VIEW3D_PT_tools_armatureedit,
1389     VIEW3D_PT_tools_armatureedit_options,
1390     VIEW3D_PT_tools_mballedit,
1391     VIEW3D_PT_tools_latticeedit,
1392     VIEW3D_PT_tools_posemode,
1393     VIEW3D_PT_tools_posemode_options,
1394     VIEW3D_PT_tools_brush,
1395     VIEW3D_PT_tools_brush_texture,
1396     VIEW3D_PT_tools_brush_stroke,
1397     VIEW3D_PT_tools_brush_curve,
1398     VIEW3D_PT_tools_brush_appearance,
1399     VIEW3D_PT_tools_brush_tool,
1400     VIEW3D_PT_sculpt_symmetry,
1401     VIEW3D_PT_sculpt_options,
1402     VIEW3D_PT_tools_vertexpaint,
1403     VIEW3D_PT_tools_weightpaint_options,
1404     VIEW3D_PT_imagepaint_options,
1405
1406     VIEW3D_PT_tools_projectpaint,
1407     VIEW3D_MT_tools_projectpaint_clone,
1408     VIEW3D_MT_tools_projectpaint_stencil,
1409
1410     VIEW3D_PT_tools_particlemode]
1411
1412
1413 def register():
1414     register = bpy.types.register
1415     for cls in classes:
1416         register(cls)
1417
1418
1419 def unregister():
1420     unregister = bpy.types.unregister
1421     for cls in classes:
1422         unregister(cls)
1423
1424 if __name__ == "__main__":
1425     register()