pep8 cleanup
[blender.git] / release / scripts / ui / space_image.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21
22
23 class BrushButtonsPanel():
24     bl_space_type = 'IMAGE_EDITOR'
25     bl_region_type = 'UI'
26
27     @classmethod
28     def poll(cls, context):
29         sima = context.space_data
30         toolsettings = context.tool_settings.image_paint
31         return sima.show_paint and toolsettings.brush
32
33
34 class IMAGE_MT_view(bpy.types.Menu):
35     bl_label = "View"
36
37     def draw(self, context):
38         layout = self.layout
39
40         sima = context.space_data
41         uv = sima.uv_editor
42         toolsettings = context.tool_settings
43
44         show_uvedit = sima.show_uvedit
45
46         layout.operator("image.properties", icon='MENU_PANEL')
47         layout.operator("image.scopes", icon='MENU_PANEL')
48
49         layout.separator()
50
51         layout.prop(sima, "use_realtime_update")
52         if show_uvedit:
53             layout.prop(toolsettings, "show_uv_local_view")
54             layout.prop(uv, "show_other_objects")
55
56         layout.separator()
57
58         layout.operator("image.view_zoom_in")
59         layout.operator("image.view_zoom_out")
60
61         layout.separator()
62
63         ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]]
64
65         for a, b in ratios:
66             text = "Zoom %d:%d" % (a, b)
67             layout.operator("image.view_zoom_ratio", text=text).ratio = a / b
68
69         layout.separator()
70
71         if show_uvedit:
72             layout.operator("image.view_selected")
73
74         layout.operator("image.view_all")
75
76         layout.separator()
77
78         layout.operator("screen.area_dupli")
79         layout.operator("screen.screen_full_area")
80
81
82 class IMAGE_MT_select(bpy.types.Menu):
83     bl_label = "Select"
84
85     def draw(self, context):
86         layout = self.layout
87
88         layout.operator("uv.select_border")
89         layout.operator("uv.select_border").pinned = True
90
91         layout.separator()
92
93         layout.operator("uv.select_all")
94         layout.operator("uv.select_inverse")
95         layout.operator("uv.unlink_selection")
96
97         layout.separator()
98
99         layout.operator("uv.select_pinned")
100         layout.operator("uv.select_linked")
101
102
103 class IMAGE_MT_image(bpy.types.Menu):
104     bl_label = "Image"
105
106     def draw(self, context):
107         layout = self.layout
108
109         sima = context.space_data
110         ima = sima.image
111
112         layout.operator("image.new")
113         layout.operator("image.open")
114
115         show_render = sima.show_render
116
117         if ima:
118             if not show_render:
119                 layout.operator("image.replace")
120                 layout.operator("image.reload")
121
122             layout.operator("image.save")
123             layout.operator("image.save_as")
124             layout.operator("image.save_as", text="Save a Copy").copy = True
125
126             if ima.source == 'SEQUENCE':
127                 layout.operator("image.save_sequence")
128
129             layout.operator("image.external_edit", "Edit Externally")
130
131             layout.separator()
132
133             layout.menu("IMAGE_MT_image_invert")
134
135             if not show_render:
136                 layout.separator()
137
138                 if ima.packed_file:
139                     layout.operator("image.unpack")
140                 else:
141                     layout.operator("image.pack")
142
143                 # only for dirty && specific image types, perhaps
144                 # this could be done in operator poll too
145                 if ima.is_dirty:
146                     if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
147                         layout.operator("image.pack", text="Pack As PNG").as_png = True
148
149             layout.separator()
150
151             layout.prop(sima, "use_image_paint")
152
153
154 class IMAGE_MT_image_invert(bpy.types.Menu):
155     bl_label = "Invert"
156
157     def draw(self, context):
158         layout = self.layout
159
160         op = layout.operator("image.invert", text="Invert Image Colors")
161         op.invert_r = True
162         op.invert_g = True
163         op.invert_b = True
164
165         layout.separator()
166
167         op = layout.operator("image.invert", text="Invert Red Channel")
168         op.invert_r = True
169
170         op = layout.operator("image.invert", text="Invert Green Channel")
171         op.invert_g = True
172
173         op = layout.operator("image.invert", text="Invert Blue Channel")
174         op.invert_b = True
175
176         op = layout.operator("image.invert", text="Invert Alpha Channel")
177         op.invert_a = True
178
179
180 class IMAGE_MT_uvs_showhide(bpy.types.Menu):
181     bl_label = "Show/Hide Faces"
182
183     def draw(self, context):
184         layout = self.layout
185
186         layout.operator("uv.reveal")
187         layout.operator("uv.hide", text="Hide Selected")
188         layout.operator("uv.hide", text="Hide Unselected").unselected = True
189
190
191 class IMAGE_MT_uvs_transform(bpy.types.Menu):
192     bl_label = "Transform"
193
194     def draw(self, context):
195         layout = self.layout
196
197         layout.operator("transform.translate")
198         layout.operator("transform.rotate")
199         layout.operator("transform.resize")
200
201
202 class IMAGE_MT_uvs_snap(bpy.types.Menu):
203     bl_label = "Snap"
204
205     def draw(self, context):
206         layout = self.layout
207         layout.operator_context = 'EXEC_REGION_WIN'
208
209         layout.operator("uv.snap_selection", text="Selected to Pixels").target = 'PIXELS'
210         layout.operator("uv.snap_selection", text="Selected to Cursor").target = 'CURSOR'
211         layout.operator("uv.snap_selection", text="Selected to Adjacent Unselected").target = 'ADJACENT_UNSELECTED'
212
213         layout.separator()
214
215         layout.operator("uv.snap_cursor", text="Cursor to Pixels").target = 'PIXELS'
216         layout.operator("uv.snap_cursor", text="Cursor to Selection").target = 'SELECTION'
217
218
219 class IMAGE_MT_uvs_mirror(bpy.types.Menu):
220     bl_label = "Mirror"
221
222     def draw(self, context):
223         layout = self.layout
224         layout.operator_context = 'EXEC_REGION_WIN'
225
226         layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True
227         layout.operator("transform.mirror", text="Y Axis").constraint_axis[1] = True
228
229
230 class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
231     bl_label = "Weld/Align"
232
233     def draw(self, context):
234         layout = self.layout
235
236         layout.operator("uv.weld")  # W, 1
237         layout.operator_enum("uv.align", "axis")  # W, 2/3/4
238
239
240 class IMAGE_MT_uvs(bpy.types.Menu):
241     bl_label = "UVs"
242
243     def draw(self, context):
244         layout = self.layout
245
246         sima = context.space_data
247         uv = sima.uv_editor
248         toolsettings = context.tool_settings
249
250         layout.prop(uv, "use_snap_to_pixels")
251         layout.prop(uv, "lock_bounds")
252
253         layout.separator()
254
255         layout.prop(uv, "use_live_unwrap")
256         layout.operator("uv.unwrap")
257         layout.operator("uv.pin", text="Unpin").clear = True
258         layout.operator("uv.pin")
259
260         layout.separator()
261
262         layout.operator("uv.pack_islands")
263         layout.operator("uv.average_islands_scale")
264         layout.operator("uv.minimize_stretch")
265         layout.operator("uv.stitch")
266         layout.operator("mesh.faces_miror_uv")
267
268         layout.separator()
269
270         layout.menu("IMAGE_MT_uvs_transform")
271         layout.menu("IMAGE_MT_uvs_mirror")
272         layout.menu("IMAGE_MT_uvs_snap")
273         layout.menu("IMAGE_MT_uvs_weldalign")
274
275         layout.separator()
276
277         layout.prop_menu_enum(toolsettings, "proportional_edit")
278         layout.prop_menu_enum(toolsettings, "proportional_edit_falloff")
279
280         layout.separator()
281
282         layout.menu("IMAGE_MT_uvs_showhide")
283
284
285 class IMAGE_MT_uvs_select_mode(bpy.types.Menu):
286     bl_label = "UV Select Mode"
287
288     def draw(self, context):
289         layout = self.layout
290
291         layout.operator_context = 'INVOKE_REGION_WIN'
292         toolsettings = context.tool_settings
293
294         # do smart things depending on whether uv_select_sync is on
295
296         if toolsettings.use_uv_select_sync:
297             prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
298             prop.value = "(True, False, False)"
299             prop.data_path = "tool_settings.mesh_select_mode"
300
301             prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
302             prop.value = "(False, True, False)"
303             prop.data_path = "tool_settings.mesh_select_mode"
304
305             prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
306             prop.value = "(False, False, True)"
307             prop.data_path = "tool_settings.mesh_select_mode"
308
309         else:
310             prop = layout.operator("wm.context_set_string", text="Vertex", icon='UV_VERTEXSEL')
311             prop.value = "VERTEX"
312             prop.data_path = "tool_settings.uv_select_mode"
313
314             prop = layout.operator("wm.context_set_string", text="Edge", icon='UV_EDGESEL')
315             prop.value = "EDGE"
316             prop.data_path = "tool_settings.uv_select_mode"
317
318             prop = layout.operator("wm.context_set_string", text="Face", icon='UV_FACESEL')
319             prop.value = "FACE"
320             prop.data_path = "tool_settings.uv_select_mode"
321
322             prop = layout.operator("wm.context_set_string", text="Island", icon='UV_ISLANDSEL')
323             prop.value = "ISLAND"
324             prop.data_path = "tool_settings.uv_select_mode"
325
326
327 class IMAGE_HT_header(bpy.types.Header):
328     bl_space_type = 'IMAGE_EDITOR'
329
330     def draw(self, context):
331         layout = self.layout
332
333         sima = context.space_data
334         ima = sima.image
335         iuser = sima.image_user
336         toolsettings = context.tool_settings
337
338         show_render = sima.show_render
339         # show_paint = sima.show_paint
340         show_uvedit = sima.show_uvedit
341
342         row = layout.row(align=True)
343         row.template_header()
344
345         # menus
346         if context.area.show_menus:
347             sub = row.row(align=True)
348             sub.menu("IMAGE_MT_view")
349
350             if show_uvedit:
351                 sub.menu("IMAGE_MT_select")
352
353             if ima and ima.is_dirty:
354                 sub.menu("IMAGE_MT_image", text="Image*")
355             else:
356                 sub.menu("IMAGE_MT_image", text="Image")
357
358             if show_uvedit:
359                 sub.menu("IMAGE_MT_uvs")
360
361         layout.template_ID(sima, "image", new="image.new")
362         if not show_render:
363             layout.prop(sima, "use_image_pin", text="")
364
365         # uv editing
366         if show_uvedit:
367             uvedit = sima.uv_editor
368
369             layout.prop(uvedit, "pivot_point", text="", icon_only=True)
370             layout.prop(toolsettings, "use_uv_select_sync", text="")
371
372             if toolsettings.use_uv_select_sync:
373                 row = layout.row(align=True)
374                 row.prop(toolsettings, "mesh_select_mode", text="", index=0, icon='VERTEXSEL')
375                 row.prop(toolsettings, "mesh_select_mode", text="", index=1, icon='EDGESEL')
376                 row.prop(toolsettings, "mesh_select_mode", text="", index=2, icon='FACESEL')
377             else:
378                 layout.prop(toolsettings, "uv_select_mode", text="", expand=True)
379                 layout.prop(uvedit, "sticky_select_mode", text="", icon_only=True)
380
381             row = layout.row(align=True)
382             row.prop(toolsettings, "proportional_edit", text="", icon_only=True)
383             if toolsettings.proportional_edit != 'DISABLED':
384                 row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
385
386             row = layout.row(align=True)
387             row.prop(toolsettings, "use_snap", text="")
388             row.prop(toolsettings, "snap_element", text="", icon_only=True)
389
390             # mesh = context.edit_object.data
391             # row.prop_search(mesh.uv_textures, "active", mesh, "uv_textures")
392
393         if ima:
394             # layers
395             layout.template_image_layers(ima, iuser)
396
397             # painting
398             layout.prop(sima, "use_image_paint", text="")
399
400             # draw options
401             row = layout.row(align=True)
402             row.prop(sima, "draw_channels", text="", expand=True)
403
404             row = layout.row(align=True)
405             if ima.type == 'COMPOSITE':
406                 row.operator("image.record_composite", icon='REC')
407             if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
408                 row.operator("image.play_composite", icon='PLAY')
409
410         if show_uvedit or sima.use_image_paint:
411             layout.prop(sima, "use_realtime_update", text="", icon_only=True, icon='LOCKED')
412
413
414 class IMAGE_PT_image_properties(bpy.types.Panel):
415     bl_space_type = 'IMAGE_EDITOR'
416     bl_region_type = 'UI'
417     bl_label = "Image"
418
419     @classmethod
420     def poll(cls, context):
421         sima = context.space_data
422         return (sima.image)
423
424     def draw(self, context):
425         layout = self.layout
426
427         sima = context.space_data
428         # ima = sima.image
429         iuser = sima.image_user
430
431         layout.template_image(sima, "image", iuser)
432
433
434 class IMAGE_PT_game_properties(bpy.types.Panel):
435     bl_space_type = 'IMAGE_EDITOR'
436     bl_region_type = 'UI'
437     bl_label = "Game Properties"
438
439     @classmethod
440     def poll(cls, context):
441         rd = context.scene.render
442         sima = context.space_data
443         return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
444
445     def draw(self, context):
446         layout = self.layout
447
448         sima = context.space_data
449         ima = sima.image
450
451         split = layout.split()
452
453         col = split.column()
454
455         sub = col.column(align=True)
456         sub.prop(ima, "use_animation")
457
458         subsub = sub.column()
459         subsub.active = ima.use_animation
460         subsub.prop(ima, "frame_start", text="Start")
461         subsub.prop(ima, "frame_end", text="End")
462         subsub.prop(ima, "fps", text="Speed")
463
464         col.prop(ima, "use_tiles")
465         sub = col.column(align=True)
466         sub.active = ima.use_tiles or ima.use_animation
467         sub.prop(ima, "tiles_x", text="X")
468         sub.prop(ima, "tiles_y", text="Y")
469
470         col = split.column()
471         col.label(text="Clamp:")
472         col.prop(ima, "use_clamp_x", text="X")
473         col.prop(ima, "use_clamp_y", text="Y")
474         col.separator()
475         col.prop(ima, "mapping", expand=True)
476
477
478 class IMAGE_PT_view_histogram(bpy.types.Panel):
479     bl_space_type = 'IMAGE_EDITOR'
480     bl_region_type = 'PREVIEW'
481     bl_label = "Histogram"
482
483     @classmethod
484     def poll(cls, context):
485         sima = context.space_data
486         return (sima and sima.image)
487
488     def draw(self, context):
489         layout = self.layout
490
491         sima = context.space_data
492
493         layout.template_histogram(sima.scopes, "histogram")
494         layout.prop(sima.scopes.histogram, "mode", icon_only=True)
495
496
497 class IMAGE_PT_view_waveform(bpy.types.Panel):
498     bl_space_type = 'IMAGE_EDITOR'
499     bl_region_type = 'PREVIEW'
500     bl_label = "Waveform"
501
502     @classmethod
503     def poll(cls, context):
504         sima = context.space_data
505         return (sima and sima.image)
506
507     def draw(self, context):
508         layout = self.layout
509
510         sima = context.space_data
511         layout.template_waveform(sima, "scopes")
512         sub = layout.row().split(percentage=0.75)
513         sub.prop(sima.scopes, "waveform_alpha")
514         sub.prop(sima.scopes, "waveform_mode", text="", icon_only=True)
515
516
517 class IMAGE_PT_view_vectorscope(bpy.types.Panel):
518     bl_space_type = 'IMAGE_EDITOR'
519     bl_region_type = 'PREVIEW'
520     bl_label = "Vectorscope"
521
522     @classmethod
523     def poll(cls, context):
524         sima = context.space_data
525         return (sima and sima.image)
526
527     def draw(self, context):
528         layout = self.layout
529
530         sima = context.space_data
531         layout.template_vectorscope(sima, "scopes")
532         layout.prop(sima.scopes, "vectorscope_alpha")
533
534
535 class IMAGE_PT_sample_line(bpy.types.Panel):
536     bl_space_type = 'IMAGE_EDITOR'
537     bl_region_type = 'PREVIEW'
538     bl_label = "Sample Line"
539
540     @classmethod
541     def poll(cls, context):
542         sima = context.space_data
543         return (sima and sima.image)
544
545     def draw(self, context):
546         layout = self.layout
547         layout.operator("image.sample_line")
548         sima = context.space_data
549         layout.template_histogram(sima, "sample_histogram")
550         layout.prop(sima.sample_histogram, "mode")
551
552
553 class IMAGE_PT_scope_sample(bpy.types.Panel):
554     bl_space_type = 'IMAGE_EDITOR'
555     bl_region_type = 'PREVIEW'
556     bl_label = "Scope Samples"
557
558     @classmethod
559     def poll(cls, context):
560         sima = context.space_data
561         return sima
562
563     def draw(self, context):
564         layout = self.layout
565         sima = context.space_data
566         split = layout.split()
567         row = split.row()
568         row.prop(sima.scopes, "use_full_resolution")
569         row = split.row()
570         row.active = not sima.scopes.use_full_resolution
571         row.prop(sima.scopes, "accuracy")
572
573
574 class IMAGE_PT_view_properties(bpy.types.Panel):
575     bl_space_type = 'IMAGE_EDITOR'
576     bl_region_type = 'UI'
577     bl_label = "Display"
578
579     @classmethod
580     def poll(cls, context):
581         sima = context.space_data
582         return (sima and (sima.image or sima.show_uvedit))
583
584     def draw(self, context):
585         layout = self.layout
586
587         sima = context.space_data
588         ima = sima.image
589         show_uvedit = sima.show_uvedit
590         uvedit = sima.uv_editor
591
592         split = layout.split()
593
594         col = split.column()
595         if ima:
596             col.prop(ima, "display_aspect", text="Aspect Ratio")
597
598             col = split.column()
599             col.label(text="Coordinates:")
600             col.prop(sima, "show_repeat", text="Repeat")
601             if show_uvedit:
602                 col.prop(uvedit, "show_normalized_coords", text="Normalized")
603
604         elif show_uvedit:
605             col.label(text="Coordinates:")
606             col.prop(uvedit, "show_normalized_coords", text="Normalized")
607
608         if show_uvedit:
609
610             col = layout.column()
611             col.prop(uvedit, "cursor_location")
612
613             col = layout.column()
614             col.label(text="UVs:")
615             row = col.row()
616             row.prop(uvedit, "edge_draw_type", expand=True)
617
618             split = layout.split()
619             col = split.column()
620             col.prop(uvedit, "show_smooth_edges", text="Smooth")
621             col.prop(uvedit, "show_modified_edges", text="Modified")
622             #col.prop(uvedit, "show_edges")
623             #col.prop(uvedit, "show_faces")
624
625             col = split.column()
626             col.prop(uvedit, "show_stretch", text="Stretch")
627             sub = col.column()
628             sub.active = uvedit.show_stretch
629             sub.row().prop(uvedit, "draw_stretch_type", expand=True)
630
631
632 class IMAGE_PT_paint(bpy.types.Panel):
633     bl_space_type = 'IMAGE_EDITOR'
634     bl_region_type = 'UI'
635     bl_label = "Paint"
636
637     @classmethod
638     def poll(cls, context):
639         sima = context.space_data
640         return sima.show_paint
641
642     def draw(self, context):
643         layout = self.layout
644
645         toolsettings = context.tool_settings.image_paint
646         brush = toolsettings.brush
647
648         col = layout.split().column()
649         row = col.row()
650         col.template_ID_preview(toolsettings, "brush", new="brush.add", rows=3, cols=8)
651
652         if brush:
653             col = layout.column()
654             col.template_color_wheel(brush, "color", value_slider=True)
655             col.prop(brush, "color", text="")
656
657             row = col.row(align=True)
658             row.prop(brush, "size", slider=True)
659             row.prop(brush, "use_pressure_size", toggle=True, text="")
660
661             row = col.row(align=True)
662             row.prop(brush, "strength", slider=True)
663             row.prop(brush, "use_pressure_strength", toggle=True, text="")
664
665             row = col.row(align=True)
666             row.prop(brush, "jitter", slider=True)
667             row.prop(brush, "use_pressure_jitter", toggle=True, text="")
668
669             col.prop(brush, "blend", text="Blend")
670
671             if brush.imagepaint_tool == 'CLONE':
672                 col.separator()
673                 col.prop(brush, "clone_image", text="Image")
674                 col.prop(brush, "clone_alpha", text="Alpha")
675
676
677 class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, bpy.types.Panel):
678     bl_label = "Texture"
679     bl_options = {'DEFAULT_CLOSED'}
680
681     def draw(self, context):
682         layout = self.layout
683
684         toolsettings = context.tool_settings.image_paint
685         brush = toolsettings.brush
686
687 #        tex_slot = brush.texture_slot
688
689         col = layout.column()
690
691         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
692
693
694 class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, bpy.types.Panel):
695     bl_label = "Tool"
696     bl_options = {'DEFAULT_CLOSED'}
697
698     def draw(self, context):
699         layout = self.layout
700         settings = context.tool_settings.image_paint
701         brush = settings.brush
702
703         col = layout.column(align=True)
704
705         col.prop(brush, "imagepaint_tool", expand=False, text="")
706
707         row = layout.row(align=True)
708         row.prop(brush, "use_paint_sculpt", text="", icon='SCULPTMODE_HLT')
709         row.prop(brush, "use_paint_vertex", text="", icon='VPAINT_HLT')
710         row.prop(brush, "use_paint_weight", text="", icon='WPAINT_HLT')
711         row.prop(brush, "use_paint_texture", text="", icon='TPAINT_HLT')
712
713
714 class IMAGE_PT_paint_stroke(BrushButtonsPanel, bpy.types.Panel):
715     bl_label = "Paint Stroke"
716     bl_options = {'DEFAULT_CLOSED'}
717
718     def draw(self, context):
719         layout = self.layout
720
721         toolsettings = context.tool_settings.image_paint
722         brush = toolsettings.brush
723
724         layout.prop(brush, "use_airbrush")
725         col = layout.column()
726         col.active = brush.use_airbrush
727         col.prop(brush, "rate", slider=True)
728
729         layout.prop(brush, "use_space")
730         row = layout.row(align=True)
731         row.active = brush.use_space
732         row.prop(brush, "spacing", text="Distance", slider=True)
733         row.prop(brush, "use_pressure_spacing", toggle=True, text="")
734
735         layout.prop(brush, "use_wrap")
736
737
738 class IMAGE_PT_paint_curve(BrushButtonsPanel, bpy.types.Panel):
739     bl_label = "Paint Curve"
740     bl_options = {'DEFAULT_CLOSED'}
741
742     def draw(self, context):
743         layout = self.layout
744
745         toolsettings = context.tool_settings.image_paint
746         brush = toolsettings.brush
747
748         layout.template_curve_mapping(brush, "curve")
749
750         row = layout.row(align=True)
751         row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape = 'SMOOTH'
752         row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape = 'ROUND'
753         row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'ROOT'
754         row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = 'SHARP'
755         row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LINE'
756         row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX'
757
758
759 def register():
760     bpy.utils.register_module(__name__)
761
762
763 def unregister():
764     bpy.utils.unregister_module(__name__)
765
766 if __name__ == "__main__":
767     register()