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