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