58b8bf718b3d142a804b7c218f58b32452113aa7
[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
170         col.menu("VIEW3D_MT_edit_mesh_extrude")
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.menu("VIEW3D_MT_uv_map", text="Unwrap")
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, "use_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
691             if brush.image_tool == 'DRAW' and brush.blend not in ('ERASE_ALPHA', 'ADD_ALPHA'):
692                 col.template_color_picker(brush, "color", value_slider=True)
693                 col.prop(brush, "color", text="")
694
695             row = col.row(align=True)
696             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
697             self.prop_unified_size(row, context, brush, "use_pressure_size")
698
699             row = col.row(align=True)
700             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
701             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
702
703             row = col.row(align=True)
704
705             col.prop(brush, "blend", text="Blend")
706
707             col = layout.column()
708             col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'})
709             col.prop(brush, "use_alpha")
710
711             col = layout.column(align=True)
712             col.label(text="Overlay:")
713
714             row = col.row()            
715             if brush.use_cursor_overlay:
716                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
717             else:
718                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
719         
720             sub = row.row()
721             sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
722             sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
723
724
725         # Weight Paint Mode #
726         elif context.weight_paint_object and brush:
727             layout.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
728             layout.prop(toolsettings, "use_multipaint", text="Multi-Paint")
729
730             col = layout.column()
731
732             row = col.row(align=True)
733             self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
734
735             row = col.row(align=True)
736             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
737             self.prop_unified_size(row, context, brush, "use_pressure_size")
738
739             row = col.row(align=True)
740             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
741             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
742
743             row = col.row(align=True)
744
745             col.prop(brush, "vertex_tool", text="Blend")
746
747         # Vertex Paint Mode #
748         elif context.vertex_paint_object and brush:
749             col = layout.column()
750             col.template_color_picker(brush, "color", value_slider=True)
751             col.prop(brush, "color", text="")
752
753             row = col.row(align=True)
754             self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
755             self.prop_unified_size(row, context, brush, "use_pressure_size")
756
757             row = col.row(align=True)
758             self.prop_unified_strength(row, context, brush, "strength", text="Strength")
759             self.prop_unified_strength(row, context, brush, "use_pressure_strength")
760
761             # XXX - TODO
762             #row = col.row(align=True)
763             #row.prop(brush, "jitter", slider=True)
764             #row.prop(brush, "use_pressure_jitter", toggle=True, text="")
765
766             col.prop(brush, "vertex_tool", text="Blend")
767
768             col = layout.column(align=True)
769             col.label(text="Overlay:")
770
771             row = col.row()
772             if brush.use_cursor_overlay:
773                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
774             else:
775                 row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
776         
777             sub = row.row()
778             sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
779             sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
780
781
782 class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
783     bl_label = "Texture"
784     bl_options = {'DEFAULT_CLOSED'}
785
786     @classmethod
787     def poll(cls, context):
788         settings = cls.paint_settings(context)
789         return (settings and settings.brush and
790                 (context.sculpt_object or context.image_paint_object or context.vertex_paint_object))
791
792     def draw(self, context):
793         layout = self.layout
794
795         settings = self.paint_settings(context)
796         brush = settings.brush
797         tex_slot = brush.texture_slot
798
799         col = layout.column()
800
801         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
802
803         brush_texture_settings(col, brush, context.sculpt_object)
804
805         # use_texture_overlay and texture_overlay_alpha
806         col = layout.column(align=True)
807         col.active = brush.brush_capabilities.has_overlay
808         col.label(text="Overlay:")
809
810         row = col.row()
811         if tex_slot.map_mode != 'STENCIL':
812             if brush.use_primary_overlay:
813                 row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
814             else:
815                 row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
816         
817         sub = row.row()
818         sub.prop(brush, "texture_overlay_alpha", text="Alpha")
819         sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
820
821
822 class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
823     bl_context = "imagepaint"
824     bl_label = "Texture Mask"
825     bl_options = {'DEFAULT_CLOSED'}
826
827     @classmethod
828     def poll(cls, context):
829         brush = context.tool_settings.image_paint.brush
830         return (context.image_paint_object and brush)
831
832     def draw(self, context):
833         layout = self.layout
834
835         brush = context.tool_settings.image_paint.brush
836         tex_slot_alpha = brush.mask_texture_slot
837
838         col = layout.column()
839
840         col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
841
842         brush_mask_texture_settings(col, brush)
843  
844         col = layout.column(align=True)
845         col.active = brush.brush_capabilities.has_overlay
846         col.label(text="Overlay:")
847
848         row = col.row()
849         if tex_slot_alpha.map_mode != 'STENCIL':
850             if brush.use_secondary_overlay:
851                 row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
852             else:
853                 row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
854         
855         sub = row.row()
856         sub.prop(brush, "mask_overlay_alpha", text="Alpha")
857         sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
858
859
860 class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
861     bl_label = "Stroke"
862     bl_options = {'DEFAULT_CLOSED'}
863
864     @classmethod
865     def poll(cls, context):
866         settings = cls.paint_settings(context)
867         return (settings and
868                 settings.brush and
869                 (context.sculpt_object or
870                  context.vertex_paint_object or
871                  context.weight_paint_object or
872                  context.image_paint_object))
873
874     def draw(self, context):
875         layout = self.layout
876
877         settings = self.paint_settings(context)
878         brush = settings.brush
879
880         col = layout.column()
881
882         col.label(text="Stroke Method:")
883
884         if context.sculpt_object:
885             col.prop(brush, "sculpt_stroke_method", text="")
886         else:
887             col.prop(brush, "stroke_method", text="")
888
889         if brush.use_anchor:
890             col.separator()
891             col.prop(brush, "use_edge_to_edge", "Edge To Edge")
892
893         if brush.use_airbrush:
894             col.separator()
895             col.prop(brush, "rate", text="Rate", slider=True)
896
897         if brush.use_space:
898             col.separator()
899             row = col.row(align=True)
900             row.active = brush.use_space
901             row.prop(brush, "spacing", text="Spacing")
902             row.prop(brush, "use_pressure_spacing", toggle=True, text="")
903
904         if context.sculpt_object:
905             if brush.sculpt_capabilities.has_jitter:
906                 col.separator()
907
908                 row = col.row(align=True)
909                 if brush.use_relative_jitter:
910                     row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
911                     row.prop(brush, "jitter", slider=True)
912                 else:
913                     row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
914                     row.prop(brush, "jitter_absolute")
915                 row.prop(brush, "use_pressure_jitter", toggle=True, text="")
916             if brush.sculpt_capabilities.has_smooth_stroke:
917                 col = layout.column()
918                 col.separator()
919
920                 col.prop(brush, "use_smooth_stroke")
921
922                 sub = col.column()
923                 sub.active = brush.use_smooth_stroke
924                 sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
925                 sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
926         else:
927             col.separator()
928
929             row = col.row(align=True)
930             if brush.use_relative_jitter:
931                 row.prop(brush, "use_relative_jitter", text="", icon='LOCKED')
932                 row.prop(brush, "jitter", slider=True)
933             else:
934                 row.prop(brush, "use_relative_jitter", text="", icon='UNLOCKED')
935                 row.prop(brush, "jitter_absolute")
936             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
937
938             col = layout.column()
939             col.separator()
940
941             col.prop(brush, "use_smooth_stroke")
942
943             sub = col.column()
944             sub.active = brush.use_smooth_stroke
945             sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
946             sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
947
948
949 class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
950     bl_label = "Curve"
951     bl_options = {'DEFAULT_CLOSED'}
952
953     @classmethod
954     def poll(cls, context):
955         settings = cls.paint_settings(context)
956         return (settings and settings.brush and settings.brush.curve)
957
958     def draw(self, context):
959         layout = self.layout
960
961         settings = self.paint_settings(context)
962
963         brush = settings.brush
964
965         layout.template_curve_mapping(brush, "curve", brush=True)
966
967         row = layout.row(align=True)
968         row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH'
969         row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND'
970         row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT'
971         row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP'
972         row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE'
973         row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
974
975
976 class VIEW3D_PT_sculpt_topology(Panel, View3DPaintPanel):
977     bl_label = "Topology"
978     bl_options = {'DEFAULT_CLOSED'}
979
980     @classmethod
981     def poll(cls, context):
982         return (context.sculpt_object and context.tool_settings.sculpt)
983
984     def draw(self, context):
985         layout = self.layout
986
987         toolsettings = context.tool_settings
988         sculpt = toolsettings.sculpt
989
990         if context.sculpt_object.use_dynamic_topology_sculpting:
991             layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dynamic")
992         else:
993             layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dynamic")
994
995         col = layout.column()
996         col.active = context.sculpt_object.use_dynamic_topology_sculpting
997         col.prop(sculpt, "detail_size")
998         col.prop(sculpt, "use_smooth_shading")
999         col.prop(sculpt, "use_edge_collapse")
1000         col.operator("sculpt.optimize")
1001         col.separator()
1002         col.prop(sculpt, "symmetrize_direction")
1003         col.operator("sculpt.symmetrize")
1004
1005
1006 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
1007     bl_label = "Options"
1008     bl_options = {'DEFAULT_CLOSED'}
1009
1010     @classmethod
1011     def poll(cls, context):
1012         return (context.sculpt_object and context.tool_settings.sculpt)
1013
1014     def draw(self, context):
1015         layout = self.layout
1016
1017         toolsettings = context.tool_settings
1018         sculpt = toolsettings.sculpt
1019
1020         layout.label(text="Lock:")
1021         row = layout.row(align=True)
1022         row.prop(sculpt, "lock_x", text="X", toggle=True)
1023         row.prop(sculpt, "lock_y", text="Y", toggle=True)
1024         row.prop(sculpt, "lock_z", text="Z", toggle=True)
1025
1026         layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
1027         layout.prop(sculpt, "show_low_resolution")
1028         layout.prop(sculpt, "use_deform_only")
1029         layout.prop(sculpt, "show_diffuse_color")
1030
1031         layout.prop(sculpt, "input_samples")
1032
1033         self.unified_paint_settings(layout, context)
1034
1035
1036 class VIEW3D_PT_sculpt_symmetry(Panel, View3DPaintPanel):
1037     bl_label = "Symmetry"
1038     bl_options = {'DEFAULT_CLOSED'}
1039
1040     @classmethod
1041     def poll(cls, context):
1042         return (context.sculpt_object and context.tool_settings.sculpt)
1043
1044     def draw(self, context):
1045         layout = self.layout
1046
1047         sculpt = context.tool_settings.sculpt
1048
1049         col = layout.column(align=True)
1050         col.label(text="Mirror:")
1051         row = col.row()
1052         row.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
1053         row.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
1054         row.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
1055
1056         layout.column().prop(sculpt, "radial_symmetry", text="Radial")
1057         layout.prop(sculpt, "use_symmetry_feather", text="Feather")
1058
1059
1060 class VIEW3D_PT_tools_brush_appearance(Panel, View3DPaintPanel):
1061     bl_label = "Appearance"
1062     bl_options = {'DEFAULT_CLOSED'}
1063
1064     @classmethod
1065     def poll(cls, context):
1066         toolsettings = context.tool_settings
1067         return ((context.sculpt_object and toolsettings.sculpt) or
1068                 (context.vertex_paint_object and toolsettings.vertex_paint) or
1069                 (context.weight_paint_object and toolsettings.weight_paint) or
1070                 (context.image_paint_object and toolsettings.image_paint))
1071
1072     def draw(self, context):
1073         layout = self.layout
1074
1075         settings = self.paint_settings(context)
1076         brush = settings.brush
1077
1078         if brush is None:  # unlikely but can happen
1079             layout.label(text="Brush Unset")
1080             return
1081
1082         col = layout.column()
1083         col.prop(settings, "show_brush");
1084
1085         col = col.column()
1086         col.active = settings.show_brush
1087
1088         if context.sculpt_object and context.tool_settings.sculpt:
1089             if brush.sculpt_capabilities.has_secondary_color:
1090                 col.row().prop(brush, "cursor_color_add", text="Add")
1091                 col.row().prop(brush, "cursor_color_subtract", text="Subtract")
1092             else:
1093                 col.prop(brush, "cursor_color_add", text="")
1094         else:
1095             col.prop(brush, "cursor_color_add", text="")
1096
1097         layout.separator()
1098
1099         col = layout.column(align=True)
1100         col.prop(brush, "use_custom_icon")
1101         if brush.use_custom_icon:
1102             col.prop(brush, "icon_filepath", text="")
1103
1104 # ********** default tools for weight-paint ****************
1105
1106
1107 class VIEW3D_PT_tools_weightpaint(View3DPanel, Panel):
1108     bl_context = "weightpaint"
1109     bl_label = "Weight Tools"
1110
1111     def draw(self, context):
1112         layout = self.layout
1113
1114         ob = context.active_object
1115
1116         col = layout.column()
1117         col.active = ob.vertex_groups.active is not None
1118         col.operator("object.vertex_group_normalize_all", text="Normalize All")
1119         col.operator("object.vertex_group_normalize", text="Normalize")
1120         col.operator("object.vertex_group_mirror", text="Mirror")
1121         col.operator("object.vertex_group_invert", text="Invert")
1122         col.operator("object.vertex_group_clean", text="Clean")
1123         col.operator("object.vertex_group_levels", text="Levels")
1124         col.operator("object.vertex_group_blend", text="Blend")
1125         col.operator("object.vertex_group_transfer_weight", text="Transfer Weights")
1126         col.operator("object.vertex_group_limit_total", text="Limit Total")
1127         col.operator("object.vertex_group_fix", text="Fix Deforms")
1128         col.operator("paint.weight_gradient")
1129
1130
1131 class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
1132     bl_context = "weightpaint"
1133     bl_label = "Options"
1134
1135     def draw(self, context):
1136         layout = self.layout
1137
1138         tool_settings = context.tool_settings
1139         wpaint = tool_settings.weight_paint
1140
1141         col = layout.column()
1142
1143         col.prop(wpaint, "use_all_faces")
1144         col.prop(wpaint, "use_normal")
1145         col.prop(wpaint, "use_spray")
1146         col.prop(wpaint, "use_group_restrict")
1147
1148         obj = context.weight_paint_object
1149         if obj.type == 'MESH':
1150             mesh = obj.data
1151             col.prop(mesh, "use_mirror_x")
1152             col.prop(mesh, "use_mirror_topology")
1153
1154         col.prop(wpaint, "input_samples")
1155
1156         col.label("Show Zero Weights:")
1157         sub = col.row()
1158         sub.active = (not tool_settings.use_multipaint)
1159         sub.prop(tool_settings, "vertex_group_user", expand=True)
1160
1161         self.unified_paint_settings(col, context)
1162
1163 # ********** default tools for vertex-paint ****************
1164
1165
1166 class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel):
1167     bl_context = "vertexpaint"
1168     bl_label = "Options"
1169
1170     def draw(self, context):
1171         layout = self.layout
1172
1173         toolsettings = context.tool_settings
1174         vpaint = toolsettings.vertex_paint
1175
1176         col = layout.column()
1177         #col.prop(vpaint, "mode", text="")
1178         col.prop(vpaint, "use_all_faces")
1179         col.prop(vpaint, "use_normal")
1180         col.prop(vpaint, "use_spray")
1181
1182         col.prop(vpaint, "input_samples")
1183
1184         self.unified_paint_settings(col, context)
1185
1186 # Commented out because the Apply button isn't an operator yet, making these settings useless
1187 #~         col.label(text="Gamma:")
1188 #~         col.prop(vpaint, "gamma", text="")
1189 #~         col.label(text="Multiply:")
1190 #~         col.prop(vpaint, "mul", text="")
1191
1192 # ********** default tools for texture-paint ****************
1193
1194
1195 class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
1196     bl_context = "imagepaint"
1197     bl_label = "Project Paint"
1198
1199     @classmethod
1200     def poll(cls, context):
1201         brush = context.tool_settings.image_paint.brush
1202         return (brush is not None)
1203
1204     def draw(self, context):
1205         layout = self.layout
1206
1207         ob = context.active_object
1208         mesh = ob.data
1209         toolsettings = context.tool_settings
1210         ipaint = toolsettings.image_paint
1211         settings = toolsettings.image_paint
1212
1213         layout.prop(ipaint, "input_samples")
1214
1215         col = layout.column()
1216         col.prop(ipaint, "use_occlude")
1217         col.prop(ipaint, "use_backface_culling")
1218
1219         row = layout.row()
1220         row.prop(ipaint, "use_normal_falloff")
1221
1222         sub = row.row()
1223         sub.active = (ipaint.use_normal_falloff)
1224         sub.prop(ipaint, "normal_angle", text="")
1225
1226         split = layout.split()
1227
1228         split.prop(ipaint, "use_stencil_layer", text="Stencil")
1229
1230         row = split.row()
1231         row.active = (ipaint.use_stencil_layer)
1232         stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
1233         row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
1234         row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
1235
1236         col = layout.column()
1237         col.active = (settings.brush.image_tool == 'CLONE')
1238         col.prop(ipaint, "use_clone_layer", text="Clone from UV map")
1239         clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
1240         col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
1241
1242         layout.prop(ipaint, "seam_bleed")
1243
1244         col = layout.column()
1245         col.label(text="External Editing:")
1246
1247         row = col.split(align=True, percentage=0.55)
1248         row.operator("image.project_edit", text="Quick Edit")
1249         row.operator("image.project_apply", text="Apply")
1250
1251         col.row().prop(ipaint, "screen_grab_size", text="")
1252
1253         col.operator("paint.project_image", text="Apply Camera Image")
1254         col.operator("image.save_dirty", text="Save All Edited")
1255
1256
1257 class VIEW3D_PT_imagepaint_options(View3DPaintPanel):
1258     bl_label = "Options"
1259     bl_options = {'DEFAULT_CLOSED'}
1260
1261     @classmethod
1262     def poll(cls, context):
1263         return (context.image_paint_object and context.tool_settings.image_paint)
1264
1265     def draw(self, context):
1266         layout = self.layout
1267
1268         col = layout.column()
1269         self.unified_paint_settings(col, context)
1270
1271
1272 class VIEW3D_MT_tools_projectpaint_clone(Menu):
1273     bl_label = "Clone Layer"
1274
1275     def draw(self, context):
1276         layout = self.layout
1277
1278         for i, tex in enumerate(context.active_object.data.uv_textures):
1279             props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
1280             props.data_path = "active_object.data.uv_texture_clone_index"
1281             props.value = i
1282
1283
1284 class VIEW3D_MT_tools_projectpaint_stencil(Menu):
1285     bl_label = "Mask Layer"
1286
1287     def draw(self, context):
1288         layout = self.layout
1289         for i, tex in enumerate(context.active_object.data.uv_textures):
1290             props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
1291             props.data_path = "active_object.data.uv_texture_stencil_index"
1292             props.value = i
1293
1294
1295 class VIEW3D_PT_tools_particlemode(View3DPanel, Panel):
1296     """Default tools for particle mode"""
1297     bl_context = "particlemode"
1298     bl_label = "Options"
1299
1300     def draw(self, context):
1301         layout = self.layout
1302
1303         pe = context.tool_settings.particle_edit
1304         ob = pe.object
1305
1306         layout.prop(pe, "type", text="")
1307
1308         ptcache = None
1309
1310         if pe.type == 'PARTICLES':
1311             if ob.particle_systems:
1312                 if len(ob.particle_systems) > 1:
1313                     layout.template_list("UI_UL_list", "particle_systems", ob, "particle_systems",
1314                                          ob.particle_systems, "active_index", rows=2, maxrows=3)
1315
1316                 ptcache = ob.particle_systems.active.point_cache
1317         else:
1318             for md in ob.modifiers:
1319                 if md.type == pe.type:
1320                     ptcache = md.point_cache
1321
1322         if ptcache and len(ptcache.point_caches) > 1:
1323             layout.template_list("UI_UL_list", "particles_point_caches", ptcache, "point_caches",
1324                                  ptcache.point_caches, "active_index", rows=2, maxrows=3)
1325
1326         if not pe.is_editable:
1327             layout.label(text="Point cache must be baked")
1328             layout.label(text="in memory to enable editing!")
1329
1330         col = layout.column(align=True)
1331         if pe.is_hair:
1332             col.active = pe.is_editable
1333             col.prop(pe, "use_emitter_deflect", text="Deflect emitter")
1334             sub = col.row()
1335             sub.active = pe.use_emitter_deflect
1336             sub.prop(pe, "emitter_distance", text="Distance")
1337
1338         col = layout.column(align=True)
1339         col.active = pe.is_editable
1340         col.label(text="Keep:")
1341         col.prop(pe, "use_preserve_length", text="Lengths")
1342         col.prop(pe, "use_preserve_root", text="Root")
1343         if not pe.is_hair:
1344             col.label(text="Correct:")
1345             col.prop(pe, "use_auto_velocity", text="Velocity")
1346         col.prop(ob.data, "use_mirror_x")
1347
1348         col = layout.column(align=True)
1349         col.active = pe.is_editable
1350         col.label(text="Draw:")
1351         col.prop(pe, "draw_step", text="Path Steps")
1352         if pe.is_hair:
1353             col.prop(pe, "show_particles", text="Children")
1354         else:
1355             if pe.type == 'PARTICLES':
1356                 col.prop(pe, "show_particles", text="Particles")
1357             col.prop(pe, "use_fade_time")
1358             sub = col.row()
1359             sub.active = pe.use_fade_time
1360             sub.prop(pe, "fade_frames", slider=True)
1361
1362 if __name__ == "__main__":  # only for live edit.
1363     bpy.utils.register_module(__name__)