1 # SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 from bpy
.props
import (
13 class CarverPrefs(bpy
.types
.AddonPreferences
):
16 Enable_Tab_01
: BoolProperty(
18 description
="Some general information and settings about the add-on",
21 Enable_Tab_02
: BoolProperty(
23 description
="List of the shortcuts used during carving",
26 bpy
.types
.Scene
.Key_Create
: StringProperty(
27 name
="Object creation",
28 description
="Object creation",
32 bpy
.types
.Scene
.Key_Update
: StringProperty(
33 name
="Auto Bevel Update",
34 description
="Auto Bevel Update",
38 bpy
.types
.Scene
.Key_Bool
: StringProperty(
40 description
="Boolean operation type",
44 bpy
.types
.Scene
.Key_Brush
: StringProperty(
46 description
="Brush Mode",
50 bpy
.types
.Scene
.Key_Help
: StringProperty(
52 description
="Help display",
56 bpy
.types
.Scene
.Key_Instant
: StringProperty(
58 description
="Instantiate object",
62 bpy
.types
.Scene
.Key_Close
: StringProperty(
63 name
="Close polygonal shape",
64 description
="Close polygonal shape",
68 bpy
.types
.Scene
.Key_Apply
: StringProperty(
69 name
="Apply operation",
70 description
="Apply operation",
74 bpy
.types
.Scene
.Key_Scale
: StringProperty(
76 description
="Scale object",
80 bpy
.types
.Scene
.Key_Gapy
: StringProperty(
82 description
="Scale gap between columns",
86 bpy
.types
.Scene
.Key_Gapx
: StringProperty(
88 description
="Scale gap between columns",
92 bpy
.types
.Scene
.Key_Depth
: StringProperty(
94 description
="Cursor depth or solidify pattern",
98 bpy
.types
.Scene
.Key_BrushDepth
: StringProperty(
100 description
="Brush depth",
104 bpy
.types
.Scene
.Key_Subadd
: StringProperty(
105 name
="Add subdivision",
106 description
="Add subdivision",
110 bpy
.types
.Scene
.Key_Subrem
: StringProperty(
111 name
="Remove subdivision",
112 description
="Remove subdivision",
116 bpy
.types
.Scene
.Key_Randrot
: StringProperty(
117 name
="Random rotation",
118 description
="Random rotation",
122 bpy
.types
.Scene
.ProfilePrefix
: StringProperty(
123 name
="Profile prefix",
124 description
="Prefix to look for profiles with",
125 default
="Carver_Profile-"
128 def draw(self
, context
):
129 scene
= context
.scene
133 icon_1
= "TRIA_RIGHT" if not self
.Enable_Tab_01
else "TRIA_DOWN"
136 box
.prop(self
, "Enable_Tab_01", text
="Info and Settings", emboss
=False, icon
=icon_1
)
137 if self
.Enable_Tab_01
:
138 box
.label(text
="Carver Operator:", icon
="LAYER_ACTIVE")
139 box
.label(text
="Select a Mesh Object and press [CTRL]+[SHIFT]+[X] to carve",
141 box
.label(text
="To finish carving press [ESC] or [RIGHT CLICK]",
143 box
.prop(scene
, "ProfilePrefix", text
="Profile prefix")
145 icon_2
= "TRIA_RIGHT" if not self
.Enable_Tab_02
else "TRIA_DOWN"
147 box
.prop(self
, "Enable_Tab_02", text
="Keys", emboss
=False, icon
=icon_2
)
148 if self
.Enable_Tab_02
:
149 split
= box
.split(align
=True)
151 col
= box
.column(align
=True)
152 col
.label(text
="Object Creation:")
153 col
.prop(scene
, "Key_Create", text
="")
154 col
.label(text
="Auto bevel update:")
155 col
.prop(scene
, "Key_Update", text
="")
156 col
.label(text
="Boolean operation type:")
157 col
.prop(scene
, "Key_Bool", text
="")
158 col
.label(text
="Brush Depth:")
159 col
.prop(scene
, "Key_BrushDepth", text
="")
162 col
= box
.column(align
=True)
163 col
.label(text
="Brush Mode:")
164 col
.prop(scene
, "Key_Brush", text
="")
165 col
.label(text
="Help display:")
166 col
.prop(scene
, "Key_Help", text
="")
167 col
.label(text
="Instantiate object:")
168 col
.prop(scene
, "Key_Instant", text
="")
169 col
.label(text
="Random rotation:")
170 col
.prop(scene
, "Key_Randrot", text
="")
173 col
= box
.column(align
=True)
174 col
.label(text
="Close polygonal shape:")
175 col
.prop(scene
, "Key_Close", text
="")
176 col
.label(text
="Apply operation:")
177 col
.prop(scene
, "Key_Apply", text
="")
178 col
.label(text
="Scale object:")
179 col
.prop(scene
, "Key_Scale", text
="")
180 col
.label(text
="Subdiv add:")
181 col
.prop(scene
, "Key_Subadd", text
="")
184 col
= box
.column(align
=True)
185 col
.label(text
="Gap rows:")
186 col
.prop(scene
, "Key_Gapy", text
="")
187 col
.label(text
="Gap columns:")
188 col
.prop(scene
, "Key_Gapx", text
="")
189 col
.label(text
="Depth / Solidify:")
190 col
.prop(scene
, "Key_Depth", text
="")
191 col
.label(text
="Subdiv Remove:")
192 col
.prop(scene
, "Key_Subrem", text
="")
195 bpy
.utils
.register_class(CarverPrefs
)
198 bpy
.utils
.unregister_class(CarverPrefs
)