LEFT | RIGHT |
1 # ##### BEGIN GPL LICENSE BLOCK ##### | 1 # ##### BEGIN GPL LICENSE BLOCK ##### |
2 # | 2 # |
3 # This program is free software; you can redistribute it and/or | 3 # This program is free software; you can redistribute it and/or |
4 # modify it under the terms of the GNU General Public License | 4 # modify it under the terms of the GNU General Public License |
5 # as published by the Free Software Foundation; either version 2 | 5 # as published by the Free Software Foundation; either version 2 |
6 # of the License, or (at your option) any later version. | 6 # of the License, or (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 layout.prop(uv, "show_other_objects") | 56 layout.prop(uv, "show_other_objects") |
57 | 57 |
58 layout.separator() | 58 layout.separator() |
59 | 59 |
60 layout.operator("image.view_zoom_in") | 60 layout.operator("image.view_zoom_in") |
61 layout.operator("image.view_zoom_out") | 61 layout.operator("image.view_zoom_out") |
62 | 62 |
63 layout.separator() | 63 layout.separator() |
64 | 64 |
65 ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]] | 65 ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) |
66 | 66 |
67 for a, b in ratios: | 67 for a, b in ratios: |
68 layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a
, b)).ratio = a / b | 68 layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a
, b)).ratio = a / b |
69 | 69 |
70 layout.separator() | 70 layout.separator() |
71 | 71 |
72 if show_uvedit: | 72 if show_uvedit: |
73 layout.operator("image.view_selected") | 73 layout.operator("image.view_selected") |
74 | 74 |
75 layout.operator("image.view_all") | 75 layout.operator("image.view_all") |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 layout.separator() | 284 layout.separator() |
285 | 285 |
286 layout.prop_menu_enum(toolsettings, "proportional_edit") | 286 layout.prop_menu_enum(toolsettings, "proportional_edit") |
287 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") | 287 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff") |
288 | 288 |
289 layout.separator() | 289 layout.separator() |
290 | 290 |
291 layout.menu("IMAGE_MT_uvs_showhide") | 291 layout.menu("IMAGE_MT_uvs_showhide") |
292 layout.separator() | 292 layout.separator() |
293 layout.prop(toolsettings, "use_uv_sculpt") | 293 layout.prop(toolsettings, "use_uv_sculpt") |
294 layout.separator() | |
295 | 294 |
296 | 295 |
297 class IMAGE_MT_uvs_select_mode(Menu): | 296 class IMAGE_MT_uvs_select_mode(Menu): |
298 bl_label = "UV Select Mode" | 297 bl_label = "UV Select Mode" |
299 | 298 |
300 def draw(self, context): | 299 def draw(self, context): |
301 layout = self.layout | 300 layout = self.layout |
302 | 301 |
303 layout.operator_context = 'INVOKE_REGION_WIN' | 302 layout.operator_context = 'INVOKE_REGION_WIN' |
304 toolsettings = context.tool_settings | 303 toolsettings = context.tool_settings |
305 | 304 |
306 # do smart things depending on whether uv_select_sync is on | 305 # do smart things depending on whether uv_select_sync is on |
307 | 306 |
308 if toolsettings.use_uv_select_sync: | 307 if toolsettings.use_uv_select_sync: |
309 prop = layout.operator("wm.context_set_value", text="Vertex", icon='
VERTEXSEL') | 308 props = layout.operator("wm.context_set_value", text="Vertex", icon=
'VERTEXSEL') |
310 prop.value = "(True, False, False)" | 309 props.value = "(True, False, False)" |
311 prop.data_path = "tool_settings.mesh_select_mode" | 310 props.data_path = "tool_settings.mesh_select_mode" |
312 | 311 |
313 prop = layout.operator("wm.context_set_value", text="Edge", icon='ED
GESEL') | 312 props = layout.operator("wm.context_set_value", text="Edge", icon='E
DGESEL') |
314 prop.value = "(False, True, False)" | 313 props.value = "(False, True, False)" |
315 prop.data_path = "tool_settings.mesh_select_mode" | 314 props.data_path = "tool_settings.mesh_select_mode" |
316 | 315 |
317 prop = layout.operator("wm.context_set_value", text="Face", icon='FA
CESEL') | 316 props = layout.operator("wm.context_set_value", text="Face", icon='F
ACESEL') |
318 prop.value = "(False, False, True)" | 317 props.value = "(False, False, True)" |
319 prop.data_path = "tool_settings.mesh_select_mode" | 318 props.data_path = "tool_settings.mesh_select_mode" |
320 | 319 |
321 else: | 320 else: |
322 prop = layout.operator("wm.context_set_string", text="Vertex", icon=
'UV_VERTEXSEL') | 321 props = layout.operator("wm.context_set_string", text="Vertex", icon
='UV_VERTEXSEL') |
323 prop.value = "VERTEX" | 322 props.value = 'VERTEX' |
324 prop.data_path = "tool_settings.uv_select_mode" | 323 props.data_path = "tool_settings.uv_select_mode" |
325 | 324 |
326 prop = layout.operator("wm.context_set_string", text="Edge", icon='U
V_EDGESEL') | 325 props = layout.operator("wm.context_set_string", text="Edge", icon='
UV_EDGESEL') |
327 prop.value = "EDGE" | 326 props.value = 'EDGE' |
328 prop.data_path = "tool_settings.uv_select_mode" | 327 props.data_path = "tool_settings.uv_select_mode" |
329 | 328 |
330 prop = layout.operator("wm.context_set_string", text="Face", icon='U
V_FACESEL') | 329 props = layout.operator("wm.context_set_string", text="Face", icon='
UV_FACESEL') |
331 prop.value = "FACE" | 330 props.value = 'FACE' |
332 prop.data_path = "tool_settings.uv_select_mode" | 331 props.data_path = "tool_settings.uv_select_mode" |
333 | 332 |
334 prop = layout.operator("wm.context_set_string", text="Island", icon=
'UV_ISLANDSEL') | 333 props = layout.operator("wm.context_set_string", text="Island", icon
='UV_ISLANDSEL') |
335 prop.value = "ISLAND" | 334 props.value = 'ISLAND' |
336 prop.data_path = "tool_settings.uv_select_mode" | 335 props.data_path = "tool_settings.uv_select_mode" |
337 | 336 |
338 | 337 |
339 class IMAGE_HT_header(Header): | 338 class IMAGE_HT_header(Header): |
340 bl_space_type = 'IMAGE_EDITOR' | 339 bl_space_type = 'IMAGE_EDITOR' |
341 | 340 |
342 def draw(self, context): | 341 def draw(self, context): |
343 layout = self.layout | 342 layout = self.layout |
344 | 343 |
345 sima = context.space_data | 344 sima = context.space_data |
346 ima = sima.image | 345 ima = sima.image |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 741 |
743 | 742 |
744 class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): | 743 class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): |
745 bl_label = "Paint Curve" | 744 bl_label = "Paint Curve" |
746 bl_options = {'DEFAULT_CLOSED'} | 745 bl_options = {'DEFAULT_CLOSED'} |
747 | 746 |
748 def draw(self, context): | 747 def draw(self, context): |
749 layout = self.layout | 748 layout = self.layout |
750 | 749 |
751 toolsettings = context.tool_settings.image_paint | 750 toolsettings = context.tool_settings.image_paint |
| 751 brush = toolsettings.brush |
| 752 |
| 753 layout.template_curve_mapping(brush, "curve") |
| 754 |
| 755 row = layout.row(align=True) |
| 756 row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape =
'SMOOTH' |
| 757 row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape =
'ROUND' |
| 758 row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'R
OOT' |
| 759 row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = '
SHARP' |
| 760 row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LI
NE' |
| 761 row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX
' |
| 762 |
| 763 |
| 764 class IMAGE_UV_sculpt_curve(bpy.types.Panel): |
| 765 bl_space_type = 'IMAGE_EDITOR' |
| 766 bl_region_type = 'UI' |
| 767 bl_label = "UV Sculpt Curve" |
| 768 bl_options = {'DEFAULT_CLOSED'} |
| 769 |
| 770 @classmethod |
| 771 def poll(cls, context): |
| 772 sima = context.space_data |
| 773 toolsettings = context.tool_settings.image_paint |
| 774 return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not
(sima.show_paint and toolsettings.brush) |
| 775 |
| 776 def draw(self, context): |
| 777 layout = self.layout |
| 778 |
| 779 toolsettings = context.tool_settings.uv_sculpt |
752 brush = toolsettings.brush | 780 brush = toolsettings.brush |
753 | 781 |
754 layout.template_curve_mapping(brush, "curve") | 782 layout.template_curve_mapping(brush, "curve") |
755 | 783 |
756 row = layout.row(align=True) | 784 row = layout.row(align=True) |
757 row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape =
'SMOOTH' | 785 row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape =
'SMOOTH' |
758 row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape =
'ROUND' | 786 row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape =
'ROUND' |
759 row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'R
OOT' | 787 row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'R
OOT' |
760 row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = '
SHARP' | 788 row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = '
SHARP' |
761 row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LI
NE' | 789 row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LI
NE' |
762 row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX
' | 790 row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX
' |
763 | 791 |
764 | 792 |
765 class IMAGE_UV_sculpt_curve(bpy.types.Panel): | |
766 bl_space_type = 'IMAGE_EDITOR' | |
767 bl_region_type = 'UI' | |
768 bl_label = "UV Sculpt Curve" | |
769 bl_options = {'DEFAULT_CLOSED'} | |
770 | |
771 @classmethod | |
772 def poll(cls, context): | |
773 sima = context.space_data | |
774 toolsettings = context.tool_settings.image_paint | |
775 return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not
(sima.show_paint and toolsettings.brush) | |
776 | |
777 def draw(self, context): | |
778 layout = self.layout | |
779 | |
780 toolsettings = context.tool_settings.uv_sculpt | |
781 brush = toolsettings.brush | |
782 | |
783 layout.template_curve_mapping(brush, "curve") | |
784 | |
785 row = layout.row(align=True) | |
786 row.operator("brush.curve_preset", icon="SMOOTHCURVE", text="").shape =
'SMOOTH' | |
787 row.operator("brush.curve_preset", icon="SPHERECURVE", text="").shape =
'ROUND' | |
788 row.operator("brush.curve_preset", icon="ROOTCURVE", text="").shape = 'R
OOT' | |
789 row.operator("brush.curve_preset", icon="SHARPCURVE", text="").shape = '
SHARP' | |
790 row.operator("brush.curve_preset", icon="LINCURVE", text="").shape = 'LI
NE' | |
791 row.operator("brush.curve_preset", icon="NOCURVE", text="").shape = 'MAX
' | |
792 | |
793 | |
794 class IMAGE_UV_sculpt(bpy.types.Panel): | 793 class IMAGE_UV_sculpt(bpy.types.Panel): |
795 bl_space_type = 'IMAGE_EDITOR' | 794 bl_space_type = 'IMAGE_EDITOR' |
796 bl_region_type = 'UI' | 795 bl_region_type = 'UI' |
797 bl_label = "UV Sculpt" | 796 bl_label = "UV Sculpt" |
798 | 797 |
799 @classmethod | 798 @classmethod |
800 def poll(cls, context): | 799 def poll(cls, context): |
801 sima = context.space_data | 800 sima = context.space_data |
802 toolsettings = context.tool_settings.image_paint | 801 toolsettings = context.tool_settings.image_paint |
803 return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not
(sima.show_paint and toolsettings.brush) | 802 return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not
(sima.show_paint and toolsettings.brush) |
(...skipping 27 matching lines...) Expand all Loading... |
831 col.prop(context.tool_settings, "uv_sculpt_tool"); | 830 col.prop(context.tool_settings, "uv_sculpt_tool"); |
832 ········ | 831 ········ |
833 if context.tool_settings.uv_sculpt_tool == 'RELAX': | 832 if context.tool_settings.uv_sculpt_tool == 'RELAX': |
834 col.prop(context.tool_settings, "uv_relax_method"); | 833 col.prop(context.tool_settings, "uv_relax_method"); |
835 · | 834 · |
836 ········ | 835 ········ |
837 | 836 |
838 | 837 |
839 if __name__ == "__main__": # only for live edit. | 838 if __name__ == "__main__": # only for live edit. |
840 bpy.utils.register_module(__name__) | 839 bpy.utils.register_module(__name__) |
LEFT | RIGHT |