Update for changes in Blender's API
[blender-addons.git] / uv_magic_uv / preferences.py
blobd8cdf86bb54024229c9dd2233456019576e9f2b4
1 # <pep8-80 compliant>
3 # ##### BEGIN GPL LICENSE BLOCK #####
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # ##### END GPL LICENSE BLOCK #####
21 __author__ = "Nutti <nutti.metro@gmail.com>"
22 __status__ = "production"
23 __version__ = "5.1"
24 __date__ = "24 Feb 2018"
26 from bpy.props import (
27 FloatProperty,
28 FloatVectorProperty,
30 from bpy.types import AddonPreferences
33 class MUV_Preferences(AddonPreferences):
34 """Preferences class: Preferences for this add-on"""
36 bl_idname = __package__
38 # for UV Sculpt
39 uvsculpt_brush_color = FloatVectorProperty(
40 name="Color",
41 description="Color",
42 default=(1.0, 0.4, 0.4, 1.0),
43 min=0.0,
44 max=1.0,
45 size=4,
46 subtype='COLOR'
49 # for Overlapped UV
50 uvinsp_overlapped_color = FloatVectorProperty(
51 name="Color",
52 description="Color",
53 default=(0.0, 0.0, 1.0, 0.3),
54 min=0.0,
55 max=1.0,
56 size=4,
57 subtype='COLOR'
60 # for Flipped UV
61 uvinsp_flipped_color = FloatVectorProperty(
62 name="Color",
63 description="Color",
64 default=(1.0, 0.0, 0.0, 0.3),
65 min=0.0,
66 max=1.0,
67 size=4,
68 subtype='COLOR'
71 # for Texture Projection
72 texproj_canvas_padding = FloatVectorProperty(
73 name="Canvas Padding",
74 description="Canvas Padding",
75 size=2,
76 max=50.0,
77 min=0.0,
78 default=(20.0, 20.0))
80 # for UV Bounding Box
81 uvbb_cp_size = FloatProperty(
82 name="Size",
83 description="Control Point Size",
84 default=6.0,
85 min=3.0,
86 max=100.0)
87 uvbb_cp_react_size = FloatProperty(
88 name="React Size",
89 description="Size event fired",
90 default=10.0,
91 min=3.0,
92 max=100.0)
94 def draw(self, _):
95 layout = self.layout
97 layout.label("[Configuration]")
99 layout.label("UV Sculpt:")
100 sp = layout.split(percentage=0.05)
101 col = sp.column() # spacer
102 sp = sp.split(percentage=0.3)
103 col = sp.column()
104 col.label("Brush Color:")
105 col.prop(self, "uvsculpt_brush_color", text="")
107 layout.separator()
109 layout.label("UV Inspection:")
110 sp = layout.split(percentage=0.05)
111 col = sp.column() # spacer
112 sp = sp.split(percentage=0.3)
113 col = sp.column()
114 col.label("Overlapped UV Color:")
115 col.prop(self, "uvinsp_overlapped_color", text="")
116 sp = sp.split(percentage=0.45)
117 col = sp.column()
118 col.label("Flipped UV Color:")
119 col.prop(self, "uvinsp_flipped_color", text="")
121 layout.separator()
123 layout.label("Texture Projection:")
124 sp = layout.split(percentage=0.05)
125 col = sp.column() # spacer
126 sp = sp.split(percentage=0.3)
127 col = sp.column()
128 col.prop(self, "texproj_canvas_padding")
130 layout.separator()
132 layout.label("UV Bounding Box:")
133 sp = layout.split(percentage=0.05)
134 col = sp.column() # spacer
135 sp = sp.split(percentage=0.3)
136 col = sp.column()
137 col.label("Control Point:")
138 col.prop(self, "uvbb_cp_size")
139 col.prop(self, "uvbb_cp_react_size")
141 layout.label("--------------------------------------")
143 layout.label("[Description]")
144 column = layout.column(align=True)
145 column.label("Magic UV is composed of many UV editing features.")
146 column.label("See tutorial page if you are new to this add-on.")
147 column.label("https://github.com/nutti/Magic-UV/wiki/Tutorial")
149 layout.label("--------------------------------------")
151 layout.label("[Location]")
153 row = layout.row(align=True)
154 sp = row.split(percentage=0.5)
155 sp.label("3D View > Tool shelf > Copy/Paste UV (Object mode)")
156 sp = sp.split(percentage=1.0)
157 col = sp.column(align=True)
158 col.label("Copy/Paste UV (Among objects)")
160 row = layout.row(align=True)
161 sp = row.split(percentage=0.5)
162 sp.label("3D View > Tool shelf > Copy/Paste UV (Edit mode)")
163 sp = sp.split(percentage=1.0)
164 col = sp.column(align=True)
165 col.label("Copy/Paste UV (Among faces in 3D View)")
166 col.label("Transfer UV")
168 row = layout.row(align=True)
169 sp = row.split(percentage=0.5)
170 sp.label("3D View > Tool shelf > UV Manipulation (Edit mode)")
171 sp = sp.split(percentage=1.0)
172 col = sp.column(align=True)
173 col.label("Flip/Rotate UV")
174 col.label("Mirror UV")
175 col.label("Move UV")
176 col.label("World Scale UV")
177 col.label("Preserve UV Aspect")
178 col.label("Texture Lock")
179 col.label("Texture Wrap")
180 col.label("UV Sculpt")
182 row = layout.row(align=True)
183 sp = row.split(percentage=0.5)
184 sp.label("3D View > Tool shelf > UV Manipulation (Edit mode)")
185 sp = sp.split(percentage=1.0)
186 col = sp.column(align=True)
187 col.label("Unwrap Constraint")
188 col.label("Texture Projection")
189 col.label("UVW")
191 row = layout.row(align=True)
192 sp = row.split(percentage=0.5)
193 sp.label("UV/Image Editor > Tool shelf > Copy/Paste UV")
194 sp = sp.split(percentage=1.0)
195 col = sp.column(align=True)
196 col.label("Copy/Paste UV (Among faces in UV/Image Editor)")
198 row = layout.row(align=True)
199 sp = row.split(percentage=0.5)
200 sp.label("UV/Image Editor > Tool shelf > UV Manipulation")
201 sp = sp.split(percentage=1.0)
202 col = sp.column(align=True)
203 col.label("Align UV")
204 col.label("Smooth UV")
205 col.label("Select UV")
206 col.label("Pack UV (Extension)")
208 row = layout.row(align=True)
209 sp = row.split(percentage=0.5)
210 sp.label("UV/Image Editor > Tool shelf > Editor Enhancement")
211 sp = sp.split(percentage=1.0)
212 col = sp.column(align=True)
213 col.label("Align UV Cursor")
214 col.label("UV Cursor Location")
215 col.label("UV Bounding Box")
216 col.label("UV Inspection")