Allow hiding separate hiding of overlays on stroke.
[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         col.operator("transform.edge_slide")
164         col.operator("mesh.noise")
165         col.operator("mesh.vertices_smooth")
166
167         col = layout.column(align=True)
168         col.label(text="Add:")
169         col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Region")
170         col.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
171         col.operator("mesh.subdivide")
172         col.operator("mesh.loopcut_slide")
173         col.operator("mesh.duplicate_move", text="Duplicate")
174         col.operator("mesh.spin")
175         col.operator("mesh.screw")
176
177         row = col.row(align=True)
178         props = row.operator("mesh.knife_tool", text="Knife")
179         props.use_occlude_geometry = True
180         props.only_selected = False
181         props = row.operator("mesh.knife_tool", text="Select")
182         props.use_occlude_geometry = False
183         props.only_selected = True
184         col.operator("mesh.knife_project")
185
186         col = layout.column(align=True)
187         col.label(text="Remove:")
188         col.menu("VIEW3D_MT_edit_mesh_delete")
189         col.operator("mesh.merge")
190         col.operator("mesh.remove_doubles")
191
192         col = layout.column(align=True)
193         col.label(text="Normals:")
194         col.operator("mesh.normals_make_consistent", text="Recalculate")
195         col.operator("mesh.flip_normals", text="Flip Direction")
196
197         col = layout.column(align=True)
198         col.label(text="UV Mapping:")
199         col.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
200         col.operator("mesh.mark_seam").clear = False
201         col.operator("mesh.mark_seam", text="Clear Seam").clear = True
202
203         col = layout.column(align=True)
204         col.label(text="Shading:")
205         row = col.row(align=True)
206         row.operator("mesh.faces_shade_smooth", text="Smooth")
207         row.operator("mesh.faces_shade_flat", text="Flat")
208
209         draw_repeat_tools(context, layout)
210
211         draw_gpencil_tools(context, layout)
212
213
214 class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
215     bl_context = "mesh_edit"
216     bl_label = "Mesh Options"
217
218     @classmethod
219     def poll(cls, context):
220         return context.active_object
221
222     def draw(self, context):
223         layout = self.layout
224
225         ob = context.active_object
226
227         tool_settings = context.tool_settings
228         mesh = ob.data
229
230         col = layout.column(align=True)
231         col.active = tool_settings.proportional_edit == 'DISABLED'
232         col.prop(mesh, "use_mirror_x")
233
234         row = col.row()
235         row.active = ob.data.use_mirror_x
236         row.prop(mesh, "use_mirror_topology")
237
238         col = layout.column(align=True)
239         col.label("Edge Select Mode:")
240         col.prop(tool_settings, "edge_path_mode", text="")
241         col.prop(tool_settings, "edge_path_live_unwrap")
242         col.label("Double Threshold:")
243         col.prop(tool_settings, "double_threshold", text="")
244
245         if mesh.show_weight:
246             col.label("Show Zero Weights:")
247             col.row().prop(tool_settings, "vertex_group_user", expand=True)
248
249 # ********** default tools for editmode_curve ****************
250
251
252 class VIEW3D_PT_tools_curveedit(View3DPanel, Panel):
253     bl_context = "curve_edit"
254     bl_label = "Curve Tools"
255
256     def draw(self, context):
257         layout = self.layout
258
259         col = layout.column(align=True)
260         col.label(text="Transform:")
261         col.operator("transform.translate")
262         col.operator("transform.rotate")
263         col.operator("transform.resize", text="Scale")
264
265         col = layout.column(align=True)
266         col.operator("transform.tilt", text="Tilt")
267         col.operator("transform.transform", text="Scale Feather").mode = 'CURVE_SHRINKFATTEN'
268
269         col = layout.column(align=True)
270         col.label(text="Curve:")
271         col.operator("curve.duplicate_move", text="Duplicate")
272         col.operator("curve.delete")
273         col.operator("curve.cyclic_toggle")
274         col.operator("curve.switch_direction")
275         col.operator("curve.spline_type_set")
276         col.operator("curve.radius_set")
277         col.operator("curve.smooth_radius")
278
279         col = layout.column(align=True)
280         col.label(text="Handles:")
281         row = col.row()
282         row.operator("curve.handle_type_set", text="Auto").type = 'AUTOMATIC'
283         row.operator("curve.handle_type_set", text="Vector").type = 'VECTOR'
284         row = col.row()
285         row.operator("curve.handle_type_set", text="Align").type = 'ALIGNED'
286         row.operator("curve.handle_type_set", text="Free").type = 'FREE_ALIGN'
287
288         col = layout.column(align=True)
289         col.label(text="Modeling:")
290         col.operator("curve.extrude_move", text="Extrude")
291         col.operator("curve.subdivide")
292         col.operator("curve.smooth")
293
294         draw_repeat_tools(context, layout)
295
296         draw_gpencil_tools(context, layout)
297
298 # ********** default tools for editmode_surface ****************
299
300
301 class VIEW3D_PT_tools_surfaceedit(View3DPanel, Panel):
302     bl_context = "surface_edit"
303     bl_label = "Surface Tools"
304
305     def draw(self, context):
306         layout = self.layout
307
308         col = layout.column(align=True)
309         col.label(text="Transform:")
310         col.operator("transform.translate")
311         col.operator("transform.rotate")
312         col.operator("transform.resize", text="Scale")
313
314         col = layout.column(align=True)
315         col.label(text="Curve:")
316         col.operator("curve.duplicate_move", text="Duplicate")
317         col.operator("curve.delete")
318         col.operator("curve.cyclic_toggle")
319         col.operator("curve.switch_direction")
320
321         col = layout.column(align=True)
322         col.label(text="Modeling:")
323         col.operator("curve.extrude", text="Extrude")
324         col.operator("curve.subdivide")
325
326         draw_repeat_tools(context, layout)
327
328         draw_gpencil_tools(context, layout)
329
330 # ********** default tools for editmode_text ****************
331
332
333 class VIEW3D_PT_tools_textedit(View3DPanel, Panel):
334     bl_context = "text_edit"
335     bl_label = "Text Tools"
336
337     def draw(self, context):
338         layout = self.layout
339
340         col = layout.column(align=True)
341         col.label(text="Text Edit:")
342         col.operator("font.text_copy", text="Copy")
343         col.operator("font.text_cut", text="Cut")
344         col.operator("font.text_paste", text="Paste")
345
346         col = layout.column(align=True)
347         col.label(text="Set Case:")
348         col.operator("font.case_set", text="To Upper").case = 'UPPER'
349         col.operator("font.case_set", text="To Lower").case = 'LOWER'
350
351         col = layout.column(align=True)
352         col.label(text="Style:")
353         col.operator("font.style_toggle", text="Bold").style = 'BOLD'
354         col.operator("font.style_toggle", text="Italic").style = 'ITALIC'
355         col.operator("font.style_toggle", text="Underline").style = 'UNDERLINE'
356
357         draw_repeat_tools(context, layout)
358
359
360 # ********** default tools for editmode_armature ****************
361
362
363 class VIEW3D_PT_tools_armatureedit(View3DPanel, Panel):
364     bl_context = "armature_edit"
365     bl_label = "Armature Tools"
366
367     def draw(self, context):
368         layout = self.layout
369
370         col = layout.column(align=True)
371         col.label(text="Transform:")
372         col.operator("transform.translate")
373         col.operator("transform.rotate")
374         col.operator("transform.resize", text="Scale")
375
376         col = layout.column(align=True)
377         col.label(text="Bones:")
378         col.operator("armature.bone_primitive_add", text="Add")
379         col.operator("armature.duplicate_move", text="Duplicate")
380         col.operator("armature.delete", text="Delete")
381
382         col = layout.column(align=True)
383         col.label(text="Modeling:")
384         col.operator("armature.extrude_move")
385         col.operator("armature.subdivide", text="Subdivide")
386
387         draw_repeat_tools(context, layout)
388
389         draw_gpencil_tools(context, layout)
390
391
392 class VIEW3D_PT_tools_armatureedit_options(View3DPanel, Panel):
393     bl_context = "armature_edit"
394     bl_label = "Armature Options"
395
396     def draw(self, context):
397         arm = context.active_object.data
398
399         self.layout.prop(arm, "use_mirror_x")
400
401 # ********** default tools for editmode_mball ****************
402
403
404 class VIEW3D_PT_tools_mballedit(View3DPanel, Panel):
405     bl_context = "mball_edit"
406     bl_label = "Meta Tools"
407
408     def draw(self, context):
409         layout = self.layout
410
411         col = layout.column(align=True)
412         col.label(text="Transform:")
413         col.operator("transform.translate")
414         col.operator("transform.rotate")
415         col.operator("transform.resize", text="Scale")
416
417         draw_repeat_tools(context, layout)
418
419         draw_gpencil_tools(context, layout)
420
421 # ********** default tools for editmode_lattice ****************
422
423
424 class VIEW3D_PT_tools_latticeedit(View3DPanel, Panel):
425     bl_context = "lattice_edit"
426     bl_label = "Lattice Tools"
427
428     def draw(self, context):
429         layout = self.layout
430
431         col = layout.column(align=True)
432         col.label(text="Transform:")
433         col.operator("transform.translate")
434         col.operator("transform.rotate")
435         col.operator("transform.resize", text="Scale")
436
437         col = layout.column(align=True)
438         col.operator("lattice.make_regular")
439
440         draw_repeat_tools(context, layout)
441
442         draw_gpencil_tools(context, layout)
443
444
445 # ********** default tools for pose-mode ****************
446
447
448 class VIEW3D_PT_tools_posemode(View3DPanel, Panel):
449     bl_context = "posemode"
450     bl_label = "Pose Tools"
451
452     def draw(self, context):
453         layout = self.layout
454
455         col = layout.column(align=True)
456         col.label(text="Transform:")
457         col.operator("transform.translate")
458         col.operator("transform.rotate")
459         col.operator("transform.resize", text="Scale")
460
461         col = layout.column(align=True)
462         col.label(text="In-Between:")
463         row = col.row()
464         row.operator("pose.push", text="Push")
465         row.operator("pose.relax", text="Relax")
466         col.operator("pose.breakdown", text="Breakdowner")
467
468         col = layout.column(align=True)
469         col.label(text="Pose:")
470         row = col.row()
471         row.operator("pose.copy", text="Copy")
472         row.operator("pose.paste", text="Paste")
473
474         col = layout.column(align=True)
475         col.operator("poselib.pose_add", text="Add To Library")
476
477         draw_keyframing_tools(context, layout)
478
479         col = layout.column(align=True)
480         col.label(text="Motion Paths:")
481         row = col.row(align=True)
482         row.operator("pose.paths_calculate", text="Calculate")
483         row.operator("pose.paths_clear", text="Clear")
484
485         draw_repeat_tools(context, layout)
486
487         draw_gpencil_tools(context, layout)
488
489
490 class VIEW3D_PT_tools_posemode_options(View3DPanel, Panel):
491     bl_context = "posemode"
492     bl_label = "Pose Options"
493
494     def draw(self, context):
495         arm = context.active_object.data
496
497         self.layout.prop(arm, "use_auto_ik")
498
499 # ********** default tools for paint modes ****************
500
501
502 class View3DPaintPanel(UnifiedPaintPanel):
503     bl_space_type = 'VIEW_3D'
504     bl_region_type = 'TOOLS'
505
506
507 class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
508     bl_label = "Brush"
509
510     @classmethod
511     def poll(cls, context):
512         return cls.paint_settings(context)
513
514     def draw(self, context):
515         layout = self.layout
516
517         toolsettings = context.tool_settings
518         settings = self.paint_settings(context)
519         brush = settings.brush
520
521         if not context.particle_edit_object:
522             col = layout.split().column()
523             col.template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8)
524
525         # Particle Mode #
526         if context.particle_edit_object:
527             tool = settings.tool
528
529             layout.column().prop(settings, "tool", expand=True)
530
531             if tool != 'NONE':
532                 col = layout.column()
533                 col.prop(brush, "size", slider=True)
534                 if tool != 'ADD':
535                     col.prop(brush, "strength", slider=True)
536
537             if tool == 'ADD':
538                 col.prop(brush, "count")
539                 col = layout.column()
540                 col.prop(settings, "use_default_interpolate")
541                 sub = col.column(align=True)
542                 sub.active = settings.use_default_interpolate
543                 sub.prop(brush, "steps", slider=True)
544                 sub.prop(settings, "default_key_count", slider=True)
545             elif tool == 'LENGTH':
546                 layout.prop(brush, "length_mode", expand=True)
547             elif tool == 'PUFF':
548                 layout.prop(brush, "puff_mode", expand=True)
549                 layout.prop(brush, "use_puff_volume")
550
551         # Sculpt Mode #
552
553         elif context.sculpt_object and brush:
554             capabilities = brush.sculpt_capabilities
555
556             col = layout.column()
557
558             col.separator()
559
560             row = col.row(align=True)
561
562             ups = toolsettings.unified_paint_settings
563             if     ((ups.use_unified_size and ups.use_locked_size) or
564                     ((not ups.use_unified_size) and brush.use_locked_size)):
565                 self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
566                 self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
567             else:
568                 self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
569                 self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
570
571             self.prop_unified_size(row, context, brush, "use_pressure_size")
572
573             # strength, use_strength_pressure, and use_strength_attenuation
574             if capabilities.has_strength:
575                 col.separator()
576                 row = col.row(align=True)
577
578                 if capabilities.has_space_attenuation:
579                     if brush.use_space_attenuation:
580                         row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='LOCKED')
581                     else:
582                         row.prop(brush, "use_space_attenuation", toggle=True, text="", icon='UNLOCKED')
583
584                 self.prop_unified_strength(row, context, brush, "strength", text="Strength")
585                 self.prop_unified_strength(row, context, brush, "use_pressure_strength")
586
587             # auto_smooth_factor and use_inverse_smooth_pressure
588             if capabilities.has_auto_smooth:
589                 col.separator()
590
591                 row = col.row(align=True)
592                 row.prop(brush, "auto_smooth_factor", slider=True)
593                 row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="")
594
595             # normal_weight
596             if capabilities.has_normal_weight:
597                 col.separator()
598                 row = col.row(align=True)
599                 row.prop(brush, "normal_weight", slider=True)
600
601             # crease_pinch_factor
602             if capabilities.has_pinch_factor:
603                 col.separator()
604                 row = col.row(align=True)
605                 row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch")
606
607             # use_original_normal and sculpt_plane
608             if capabilities.has_sculpt_plane:
609                 row = col.row(align=True)
610                 col.separator()
611
612                 if brush.use_original_normal:
613                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='LOCKED')
614                 else:
615                     row.prop(brush, "use_original_normal", toggle=True, text="", icon='UNLOCKED')
616
617                 row.prop(brush, "sculpt_plane", text="")
618
619             if brush.sculpt_tool == 'MASK':
620                 col.prop(brush, "mask_tool", text="")
621
622             # plane_offset, use_offset_pressure, use_plane_trim, plane_trim
623             if capabilities.has_plane_offset:
624                 row = col.row(align=True)
625                 row.prop(brush, "plane_offset", slider=True)
626                 row.prop(brush, "use_offset_pressure", text="")
627
628                 col.separator()
629
630                 row = col.row()
631                 row.prop(brush, "use_plane_trim", text="Trim")
632                 row = col.row()
633                 row.active = brush.use_plane_trim
634                 row.prop(brush, "plane_trim", slider=True, text="Distance")
635
636             # height
637             if capabilities.has_height:
638                 row = col.row()
639                 row.prop(brush, "height", slider=True, text="Height")
640
641             # use_frontface
642             col.separator()
643             row = col.row()
644             row.prop(brush, "use_frontface", text="Front Faces Only")
645
646             # direction
647             col.separator()
648             col.row().prop(brush, "direction", expand=True)
649
650             # use_accumulate
651             if capabilities.has_accumulate:
652                 col.separator()
653
654                 col.prop(brush, "use_accumulate")
655
656             # use_persistent, set_persistent_base
657             if capabilities.has_persistence:
658                 col.separator()
659
660                 ob = context.sculpt_object
661                 do_persistent = True
662
663                 # not supported yet for this case
664                 for md in ob.modifiers:
665                     if md.type == 'MULTIRES':
666                         do_persistent = False
667                         break
668
669                 if do_persistent:
670                     col.prop(brush, "use_persistent")
671                     col.operator("sculpt.set_persistent_base")
672
673             col = layout.column(align=True)
674             col.label(text="Overlay:")
675
676             row = col.row()
677             if brush.use_cursor_overlay:
678                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
679             else:
680                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
681         
682             sub = row.row()
683             sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
684             sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
685
686         # Texture Paint Mode #
687
688         elif context.image_paint_object and brush:
689             col = layout.column()
690             col.template_color_picker(brush, "color", value_slider=True)
691             col.prop(brush, "color", text="")
692
693             row = col.row(align=True)
694             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
695             self.prop_unified_size(row, context, brush, "use_pressure_size")
696
697             row = col.row(align=True)
698             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
699             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
700
701             row = col.row(align=True)
702
703             col.prop(brush, "blend", text="Blend")
704
705             col = layout.column()
706             col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'})
707             col.prop(brush, "use_alpha")
708
709             col = layout.column(align=True)
710             col.label(text="Overlay:")
711
712             row = col.row()            
713             if brush.use_cursor_overlay:
714                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
715             else:
716                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
717         
718             sub = row.row()
719             sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
720             sub.prop(brush, "cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
721
722
723         # Weight Paint Mode #
724         elif context.weight_paint_object and brush:
725             layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
726             layout.prop(toolsettings, "use_multipaint", text="Multi-Paint")
727
728             col = layout.column()
729
730             row = col.row(align=True)
731             self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
732
733             row = col.row(align=True)
734             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
735             self.prop_unified_size(row, context, brush, "use_pressure_size")
736
737             row = col.row(align=True)
738             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
739             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
740
741             row = col.row(align=True)
742
743             col.prop(brush, "vertex_tool", text="Blend")
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()
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()
776             sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
777             sub.prop(brush, "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()
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()
816         sub.prop(brush, "texture_overlay_alpha", text="Alpha")
817         sub.prop(brush, "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 and brush.image_tool != 'SOFTEN')
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()
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()
854         sub.prop(brush, "mask_overlay_alpha", text="Alpha")
855         sub.prop(brush, "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, "show_brush")
1027         layout.prop(sculpt, "use_deform_only")
1028         layout.prop(sculpt, "show_diffuse_color")
1029
1030         layout.prop(sculpt, "input_samples")
1031
1032         self.unified_paint_settings(layout, context)
1033
1034
1035 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
1036     bl_label = "Symmetry"
1037     bl_options = {'DEFAULT_CLOSED'}
1038
1039     @classmethod
1040     def poll(cls, context):
1041         return (context.sculpt_object and context.tool_settings.sculpt)
1042
1043     def draw(self, context):
1044         layout = self.layout
1045
1046         sculpt = context.tool_settings.sculpt
1047
1048         col = layout.column(align=True)
1049         col.label(text="Mirror:")
1050         row = col.row()
1051         row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
1052         row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
1053         row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
1054
1055         layout.column().prop(sculpt, "radial_symmetry", text="Radial")
1056         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
1057
1058
1059 class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
1060     bl_label = "Appearance"
1061     bl_options = {'DEFAULT_CLOSED'}
1062
1063     @classmethod
1064     def poll(cls, context):
1065         toolsettings = context.tool_settings
1066         return ((context.sculpt_object and toolsettings.sculpt) or
1067                 (context.vertex_paint_object and toolsettings.vertex_paint) or
1068                 (context.weight_paint_object and toolsettings.weight_paint) or
1069                 (context.image_paint_object and toolsettings.image_paint))
1070
1071     def draw(self, context):
1072         layout = self.layout
1073
1074         settings = self.paint_settings(context)
1075         brush = settings.brush
1076
1077         if brush is None:  # unlikely but can happen
1078             layout.label(text="Brush Unset")
1079             return
1080
1081         col = layout.column()
1082
1083         if context.sculpt_object and context.tool_settings.sculpt:
1084             if brush.sculpt_capabilities.has_secondary_color:
1085                 col.prop(brush, "cursor_color_add", text="Add Color")
1086                 col.prop(brush, "cursor_color_subtract", text="Subtract Color")
1087             else:
1088                 col.prop(brush, "cursor_color_add", text="Color")
1089         else:
1090             col.prop(brush, "cursor_color_add", text="Color")
1091
1092         col = layout.column(align=True)
1093         col.prop(brush, "use_custom_icon")
1094         if brush.use_custom_icon:
1095             col.prop(brush, "icon_filepath", text="")
1096
1097 # ********** default tools for weight-paint ****************
1098
1099
1100 class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
1101     bl_context = "weightpaint"
1102     bl_label = "Weight Tools"
1103
1104     def draw(self, context):
1105         layout = self.layout
1106
1107         ob = context.active_object
1108
1109         col = layout.column()
1110         col.active = ob.vertex_groups.active is not None
1111         col.operator("object.vertex_group_normalize_all", text="Normalize All")
1112         col.operator("object.vertex_group_normalize", text="Normalize")
1113         col.operator("object.vertex_group_mirror", text="Mirror")
1114         col.operator("object.vertex_group_invert", text="Invert")
1115         col.operator("object.vertex_group_clean", text="Clean")
1116         col.operator("object.vertex_group_levels", text="Levels")
1117         col.operator("object.vertex_group_blend", text="Blend")
1118         col.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
1119         col.operator("object.vertex_group_limit_total", text="Limit Total")
1120         col.operator("object.vertex_group_fix", text="Fix Deforms")
1121         col.operator("paint.weight_gradient")
1122
1123
1124 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
1125     bl_context = "weightpaint"
1126     bl_label = "Options"
1127
1128     def draw(self, context):
1129         layout = self.layout
1130
1131         tool_settings = context.tool_settings
1132         wpaint = tool_settings.weight_paint
1133
1134         col = layout.column()
1135
1136         col.prop(wpaint, "use_all_faces")
1137         col.prop(wpaint, "use_normal")
1138         col.prop(wpaint, "use_spray")
1139         col.prop(wpaint, "use_group_restrict")
1140
1141         obj = context.weight_paint_object
1142         if obj.type == 'MESH':
1143             mesh = obj.data
1144             col.prop(mesh, "use_mirror_x")
1145             col.prop(mesh, "use_mirror_topology")
1146
1147         col.prop(wpaint, "input_samples")
1148
1149         col.label("Show Zero Weights:")
1150         sub = col.row()
1151         sub.active = (not tool_settings.use_multipaint)
1152         sub.prop(tool_settings, "vertex_group_user", expand=True)
1153
1154         self.unified_paint_settings(col, context)
1155
1156 # ********** default tools for vertex-paint ****************
1157
1158
1159 class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
1160     bl_context = "vertexpaint"
1161     bl_label = "Options"
1162
1163     def draw(self, context):
1164         layout = self.layout
1165
1166         toolsettings = context.tool_settings
1167         vpaint = toolsettings.vertex_paint
1168
1169         col = layout.column()
1170         #col.prop(vpaint, "mode", text="")
1171         col.prop(vpaint, "use_all_faces")
1172         col.prop(vpaint, "use_normal")
1173         col.prop(vpaint, "use_spray")
1174
1175         col.prop(vpaint, "input_samples")
1176
1177         self.unified_paint_settings(col, context)
1178
1179 # Commented out because the Apply button isn't an operator yet, making these settings useless
1180 #~         col.label(text="Gamma:")
1181 #~         col.prop(vpaint, "gamma", text="")
1182 #~         col.label(text="Multiply:")
1183 #~         col.prop(vpaint, "mul", text="")
1184
1185 # ********** default tools for texture-paint ****************
1186
1187
1188 class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
1189     bl_context = "imagepaint"
1190     bl_label = "Project Paint"
1191
1192     @classmethod
1193     def poll(cls, context):
1194         brush = context.tool_settings.image_paint.brush
1195         return (brush is not None)
1196
1197     def draw(self, context):
1198         layout = self.layout
1199
1200         ob = context.active_object
1201         mesh = ob.data
1202         toolsettings = context.tool_settings
1203         ipaint = toolsettings.image_paint
1204         settings = toolsettings.image_paint
1205
1206         layout.prop(ipaint, "input_samples")
1207
1208         col = layout.column()
1209         col.prop(ipaint, "use_occlude")
1210         col.prop(ipaint, "use_backface_culling")
1211
1212         row = layout.row()
1213         row.prop(ipaint, "use_normal_falloff")
1214
1215         sub = row.row()
1216         sub.active = (ipaint.use_normal_falloff)
1217         sub.prop(ipaint, "normal_angle", text="")
1218
1219         split = layout.split()
1220
1221         split.prop(ipaint, "use_stencil_layer", text="Stencil")
1222
1223         row = split.row()
1224         row.active = (ipaint.use_stencil_layer)
1225         stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
1226         row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
1227         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
1228
1229         col = layout.column()
1230         col.active = (settings.brush.image_tool == 'CLONE')
1231         col.prop(ipaint, "use_clone_layer", text="Clone from UV map")
1232         clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
1233         col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
1234
1235         layout.prop(ipaint, "seam_bleed")
1236
1237         col = layout.column()
1238         col.label(text="External Editing:")
1239
1240         row = col.split(align=True, percentage=0.55)
1241         row.operator("image.project_edit", text="Quick Edit")
1242         row.operator("image.project_apply", text="Apply")
1243
1244         col.row().prop(ipaint, "screen_grab_size", text="")
1245
1246         col.operator("paint.project_image", text="Apply Camera Image")
1247         col.operator("image.save_dirty", text="Save All Edited")
1248
1249
1250 class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
1251     bl_label = "Options"
1252     bl_options = {'DEFAULT_CLOSED'}
1253
1254     @classmethod
1255     def poll(cls, context):
1256         return (context.image_paint_object and context.tool_settings.image_paint)
1257
1258     def draw(self, context):
1259         layout = self.layout
1260
1261         col = layout.column()
1262         self.unified_paint_settings(col, context)
1263
1264
1265 class VIEW3D_MT_tools_projectpaint_clone(Menu):
1266     bl_label = "Clone Layer"
1267
1268     def draw(self, context):
1269         layout = self.layout
1270
1271         for i, tex in enumerate(context.active_object.data.uv_textures):
1272             props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
1273             props.data_path = "active_object.data.uv_texture_clone_index"
1274             props.value = i
1275
1276
1277 class VIEW3D_MT_tools_projectpaint_stencil(Menu):
1278     bl_label = "Mask Layer"
1279
1280     def draw(self, context):
1281         layout = self.layout
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_stencil_index"
1285             props.value = i
1286
1287
1288 class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
1289     """Default tools for particle mode"""
1290     bl_context = "particlemode"
1291     bl_label = "Options"
1292
1293     def draw(self, context):
1294         layout = self.layout
1295
1296         pe = context.tool_settings.particle_edit
1297         ob = pe.object
1298
1299         layout.prop(pe, "type", text="")
1300
1301         ptcache = None
1302
1303         if pe.type == 'PARTICLES':
1304             if ob.particle_systems:
1305                 if len(ob.particle_systems) > 1:
1306                     layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
1307                                          ob.particle_systems, "active_index", rows=2, maxrows=3)
1308
1309                 ptcache = ob.particle_systems.active.point_cache
1310         else:
1311             for md in ob.modifiers:
1312                 if md.type == pe.type:
1313                     ptcache = md.point_cache
1314
1315         if ptcache and len(ptcache.point_caches) > 1:
1316             layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
1317                                  ptcache.point_caches, "active_index", rows=2, maxrows=3)
1318
1319         if not pe.is_editable:
1320             layout.label(text="Point cache must be baked")
1321             layout.label(text="in memory to enable editing!")
1322
1323         col = layout.column(align=True)
1324         if pe.is_hair:
1325             col.active = pe.is_editable
1326             col.prop(pe, "use_emitter_deflect", text="Deflect emitter")
1327             sub = col.row()
1328             sub.active = pe.use_emitter_deflect
1329             sub.prop(pe, "emitter_distance", text="Distance")
1330
1331         col = layout.column(align=True)
1332         col.active = pe.is_editable
1333         col.label(text="Keep:")
1334         col.prop(pe, "use_preserve_length", text="Lengths")
1335         col.prop(pe, "use_preserve_root", text="Root")
1336         if not pe.is_hair:
1337             col.label(text="Correct:")
1338             col.prop(pe, "use_auto_velocity", text="Velocity")
1339         col.prop(ob.data, "use_mirror_x")
1340
1341         col = layout.column(align=True)
1342         col.active = pe.is_editable
1343         col.label(text="Draw:")
1344         col.prop(pe, "draw_step", text="Path Steps")
1345         if pe.is_hair:
1346             col.prop(pe, "show_particles", text="Children")
1347         else:
1348             if pe.type == 'PARTICLES':
1349                 col.prop(pe, "show_particles", text="Particles")
1350             col.prop(pe, "use_fade_time")
1351             sub = col.row()
1352             sub.active = pe.use_fade_time
1353             sub.prop(pe, "fade_frames", slider=True)
1354
1355 if __name__ == "__main__":  # only for live edit.
1356     bpy.utils.register_module(__name__)