Fix #104036: Copy Attributes does not work on faces
[blender-addons.git] / object_carver / carver_preferences.py
blob873a814d530f2365c80da5b39f6e10f8ab0c3739
1 # SPDX-License-Identifier: GPL-2.0-or-later
3 import bpy
4 from bpy.props import (
5 BoolProperty,
6 IntProperty,
7 PointerProperty,
8 StringProperty,
11 class CarverPrefs(bpy.types.AddonPreferences):
12 bl_idname = __name__
14 Enable_Tab_01: BoolProperty(
15 name="Info",
16 description="Some general information and settings about the add-on",
17 default=False
19 Enable_Tab_02: BoolProperty(
20 name="Hotkeys",
21 description="List of the shortcuts used during carving",
22 default=False
24 bpy.types.Scene.Key_Create: StringProperty(
25 name="Object creation",
26 description="Object creation",
27 maxlen=1,
28 default="C"
30 bpy.types.Scene.Key_Update: StringProperty(
31 name="Auto Bevel Update",
32 description="Auto Bevel Update",
33 maxlen=1,
34 default="A",
36 bpy.types.Scene.Key_Bool: StringProperty(
37 name="Boolean type",
38 description="Boolean operation type",
39 maxlen=1,
40 default="T",
42 bpy.types.Scene.Key_Brush: StringProperty(
43 name="Brush Mode",
44 description="Brush Mode",
45 maxlen=1,
46 default="B",
48 bpy.types.Scene.Key_Help: StringProperty(
49 name="Help display",
50 description="Help display",
51 maxlen=1,
52 default="H",
54 bpy.types.Scene.Key_Instant: StringProperty(
55 name="Instantiate",
56 description="Instantiate object",
57 maxlen=1,
58 default="I",
60 bpy.types.Scene.Key_Close: StringProperty(
61 name="Close polygonal shape",
62 description="Close polygonal shape",
63 maxlen=1,
64 default="X",
66 bpy.types.Scene.Key_Apply: StringProperty(
67 name="Apply operation",
68 description="Apply operation",
69 maxlen=1,
70 default="Q",
72 bpy.types.Scene.Key_Scale: StringProperty(
73 name="Scale object",
74 description="Scale object",
75 maxlen=1,
76 default="S",
78 bpy.types.Scene.Key_Gapy: StringProperty(
79 name="Gap rows",
80 description="Scale gap between columns",
81 maxlen=1,
82 default="J",
84 bpy.types.Scene.Key_Gapx: StringProperty(
85 name="Gap columns",
86 description="Scale gap between columns",
87 maxlen=1,
88 default="U",
90 bpy.types.Scene.Key_Depth: StringProperty(
91 name="Depth",
92 description="Cursor depth or solidify pattern",
93 maxlen=1,
94 default="D",
96 bpy.types.Scene.Key_BrushDepth: StringProperty(
97 name="Brush Depth",
98 description="Brush depth",
99 maxlen=1,
100 default="C",
102 bpy.types.Scene.Key_Subadd: StringProperty(
103 name="Add subdivision",
104 description="Add subdivision",
105 maxlen=1,
106 default="X",
108 bpy.types.Scene.Key_Subrem: StringProperty(
109 name="Remove subdivision",
110 description="Remove subdivision",
111 maxlen=1,
112 default="W",
114 bpy.types.Scene.Key_Randrot: StringProperty(
115 name="Random rotation",
116 description="Random rotation",
117 maxlen=1,
118 default="R",
120 bpy.types.Scene.ProfilePrefix: StringProperty(
121 name="Profile prefix",
122 description="Prefix to look for profiles with",
123 default="Carver_Profile-"
126 def draw(self, context):
127 scene = context.scene
128 layout = self.layout
129 print("DRAW !")
131 icon_1 = "TRIA_RIGHT" if not self.Enable_Tab_01 else "TRIA_DOWN"
132 box = layout.box()
134 box.prop(self, "Enable_Tab_01", text="Info and Settings", emboss=False, icon=icon_1)
135 if self.Enable_Tab_01:
136 box.label(text="Carver Operator:", icon="LAYER_ACTIVE")
137 box.label(text="Select a Mesh Object and press [CTRL]+[SHIFT]+[X] to carve",
138 icon="LAYER_USED")
139 box.label(text="To finish carving press [ESC] or [RIGHT CLICK]",
140 icon="LAYER_USED")
141 box.prop(scene, "ProfilePrefix", text="Profile prefix")
143 icon_2 = "TRIA_RIGHT" if not self.Enable_Tab_02 else "TRIA_DOWN"
144 box = layout.box()
145 box.prop(self, "Enable_Tab_02", text="Keys", emboss=False, icon=icon_2)
146 if self.Enable_Tab_02:
147 split = box.split(align=True)
148 box = split.box()
149 col = box.column(align=True)
150 col.label(text="Object Creation:")
151 col.prop(scene, "Key_Create", text="")
152 col.label(text="Auto bevel update:")
153 col.prop(scene, "Key_Update", text="")
154 col.label(text="Boolean operation type:")
155 col.prop(scene, "Key_Bool", text="")
156 col.label(text="Brush Depth:")
157 col.prop(scene, "Key_BrushDepth", text="")
159 box = split.box()
160 col = box.column(align=True)
161 col.label(text="Brush Mode:")
162 col.prop(scene, "Key_Brush", text="")
163 col.label(text="Help display:")
164 col.prop(scene, "Key_Help", text="")
165 col.label(text="Instantiate object:")
166 col.prop(scene, "Key_Instant", text="")
167 col.label(text="Random rotation:")
168 col.prop(scene, "Key_Randrot", text="")
170 box = split.box()
171 col = box.column(align=True)
172 col.label(text="Close polygonal shape:")
173 col.prop(scene, "Key_Close", text="")
174 col.label(text="Apply operation:")
175 col.prop(scene, "Key_Apply", text="")
176 col.label(text="Scale object:")
177 col.prop(scene, "Key_Scale", text="")
178 col.label(text="Subdiv add:")
179 col.prop(scene, "Key_Subadd", text="")
181 box = split.box()
182 col = box.column(align=True)
183 col.label(text="Gap rows:")
184 col.prop(scene, "Key_Gapy", text="")
185 col.label(text="Gap columns:")
186 col.prop(scene, "Key_Gapx", text="")
187 col.label(text="Depth / Solidify:")
188 col.prop(scene, "Key_Depth", text="")
189 col.label(text="Subdiv Remove:")
190 col.prop(scene, "Key_Subrem", text="")
192 def register():
193 bpy.utils.register_class(CarverPrefs)
195 def unregister():
196 bpy.utils.unregister_class(CarverPrefs)