2 from bpy
.props
import (
9 class CarverPrefs(bpy
.types
.AddonPreferences
):
12 Enable_Tab_01
: BoolProperty(
14 description
="Some general information and settings about the add-on",
17 Enable_Tab_02
: BoolProperty(
19 description
="List of the shortcuts used during carving",
22 bpy
.types
.Scene
.Key_Create
: StringProperty(
23 name
="Object creation",
24 description
="Object creation",
28 bpy
.types
.Scene
.Key_Update
: StringProperty(
29 name
="Auto Bevel Update",
30 description
="Auto Bevel Update",
34 bpy
.types
.Scene
.Key_Bool
: StringProperty(
36 description
="Boolean operation type",
40 bpy
.types
.Scene
.Key_Brush
: StringProperty(
42 description
="Brush Mode",
46 bpy
.types
.Scene
.Key_Help
: StringProperty(
48 description
="Help display",
52 bpy
.types
.Scene
.Key_Instant
: StringProperty(
54 description
="Instantiate object",
58 bpy
.types
.Scene
.Key_Close
: StringProperty(
59 name
="Close polygonal shape",
60 description
="Close polygonal shape",
64 bpy
.types
.Scene
.Key_Apply
: StringProperty(
65 name
="Apply operation",
66 description
="Apply operation",
70 bpy
.types
.Scene
.Key_Scale
: StringProperty(
72 description
="Scale object",
76 bpy
.types
.Scene
.Key_Gapy
: StringProperty(
78 description
="Scale gap between columns",
82 bpy
.types
.Scene
.Key_Gapx
: StringProperty(
84 description
="Scale gap between columns",
88 bpy
.types
.Scene
.Key_Depth
: StringProperty(
90 description
="Cursor depth or solidify pattern",
94 bpy
.types
.Scene
.Key_BrushDepth
: StringProperty(
96 description
="Brush depth",
100 bpy
.types
.Scene
.Key_Subadd
: StringProperty(
101 name
="Add subdivision",
102 description
="Add subdivision",
106 bpy
.types
.Scene
.Key_Subrem
: StringProperty(
107 name
="Remove subdivision",
108 description
="Remove subdivision",
112 bpy
.types
.Scene
.Key_Randrot
: StringProperty(
113 name
="Random rotation",
114 description
="Random rotation",
118 bpy
.types
.Scene
.ProfilePrefix
: StringProperty(
119 name
="Profile prefix",
120 description
="Prefix to look for profiles with",
121 default
="Carver_Profile-"
124 def draw(self
, context
):
125 scene
= context
.scene
129 icon_1
= "TRIA_RIGHT" if not self
.Enable_Tab_01
else "TRIA_DOWN"
132 box
.prop(self
, "Enable_Tab_01", text
="Info and Settings", emboss
=False, icon
=icon_1
)
133 if self
.Enable_Tab_01
:
134 box
.label(text
="Carver Operator:", icon
="LAYER_ACTIVE")
135 box
.label(text
="Select a Mesh Object and press [CTRL]+[SHIFT]+[X] to carve",
137 box
.label(text
="To finish carving press [ESC] or [RIGHT CLICK]",
139 box
.prop(scene
, "ProfilePrefix", text
="Profile prefix")
141 icon_2
= "TRIA_RIGHT" if not self
.Enable_Tab_02
else "TRIA_DOWN"
143 box
.prop(self
, "Enable_Tab_02", text
="Keys", emboss
=False, icon
=icon_2
)
144 if self
.Enable_Tab_02
:
145 split
= box
.split(align
=True)
147 col
= box
.column(align
=True)
148 col
.label(text
="Object Creation:")
149 col
.prop(scene
, "Key_Create", text
="")
150 col
.label(text
="Auto bevel update:")
151 col
.prop(scene
, "Key_Update", text
="")
152 col
.label(text
="Boolean operation type:")
153 col
.prop(scene
, "Key_Bool", text
="")
154 col
.label(text
="Brush Depth:")
155 col
.prop(scene
, "Key_BrushDepth", text
="")
158 col
= box
.column(align
=True)
159 col
.label(text
="Brush Mode:")
160 col
.prop(scene
, "Key_Brush", text
="")
161 col
.label(text
="Help display:")
162 col
.prop(scene
, "Key_Help", text
="")
163 col
.label(text
="Instantiate object:")
164 col
.prop(scene
, "Key_Instant", text
="")
165 col
.label(text
="Random rotation:")
166 col
.prop(scene
, "Key_Randrot", text
="")
169 col
= box
.column(align
=True)
170 col
.label(text
="Close polygonal shape:")
171 col
.prop(scene
, "Key_Close", text
="")
172 col
.label(text
="Apply operation:")
173 col
.prop(scene
, "Key_Apply", text
="")
174 col
.label(text
="Scale object:")
175 col
.prop(scene
, "Key_Scale", text
="")
176 col
.label(text
="Subdiv add:")
177 col
.prop(scene
, "Key_Subadd", text
="")
180 col
= box
.column(align
=True)
181 col
.label(text
="Gap rows:")
182 col
.prop(scene
, "Key_Gapy", text
="")
183 col
.label(text
="Gap columns:")
184 col
.prop(scene
, "Key_Gapx", text
="")
185 col
.label(text
="Depth / Solidify:")
186 col
.prop(scene
, "Key_Depth", text
="")
187 col
.label(text
="Subdiv Remove:")
188 col
.prop(scene
, "Key_Subrem", text
="")
191 bpy
.utils
.register_class(CarverPrefs
)
194 bpy
.utils
.unregister_class(CarverPrefs
)