glTF: update shader after Principled changes
[blender-addons.git] / object_carver / carver_preferences.py
blobcec7e81107cafbfdef9dfb47f30af5544cdc05fa
1 # SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 import bpy
6 from bpy.props import (
7 BoolProperty,
8 IntProperty,
9 PointerProperty,
10 StringProperty,
13 class CarverPrefs(bpy.types.AddonPreferences):
14 bl_idname = __name__
16 Enable_Tab_01: BoolProperty(
17 name="Info",
18 description="Some general information and settings about the add-on",
19 default=False
21 Enable_Tab_02: BoolProperty(
22 name="Hotkeys",
23 description="List of the shortcuts used during carving",
24 default=False
26 bpy.types.Scene.Key_Create: StringProperty(
27 name="Object creation",
28 description="Object creation",
29 maxlen=1,
30 default="C"
32 bpy.types.Scene.Key_Update: StringProperty(
33 name="Auto Bevel Update",
34 description="Auto Bevel Update",
35 maxlen=1,
36 default="A",
38 bpy.types.Scene.Key_Bool: StringProperty(
39 name="Boolean type",
40 description="Boolean operation type",
41 maxlen=1,
42 default="T",
44 bpy.types.Scene.Key_Brush: StringProperty(
45 name="Brush Mode",
46 description="Brush Mode",
47 maxlen=1,
48 default="B",
50 bpy.types.Scene.Key_Help: StringProperty(
51 name="Help display",
52 description="Help display",
53 maxlen=1,
54 default="H",
56 bpy.types.Scene.Key_Instant: StringProperty(
57 name="Instantiate",
58 description="Instantiate object",
59 maxlen=1,
60 default="I",
62 bpy.types.Scene.Key_Close: StringProperty(
63 name="Close polygonal shape",
64 description="Close polygonal shape",
65 maxlen=1,
66 default="X",
68 bpy.types.Scene.Key_Apply: StringProperty(
69 name="Apply operation",
70 description="Apply operation",
71 maxlen=1,
72 default="Q",
74 bpy.types.Scene.Key_Scale: StringProperty(
75 name="Scale object",
76 description="Scale object",
77 maxlen=1,
78 default="S",
80 bpy.types.Scene.Key_Gapy: StringProperty(
81 name="Gap rows",
82 description="Scale gap between columns",
83 maxlen=1,
84 default="J",
86 bpy.types.Scene.Key_Gapx: StringProperty(
87 name="Gap columns",
88 description="Scale gap between columns",
89 maxlen=1,
90 default="U",
92 bpy.types.Scene.Key_Depth: StringProperty(
93 name="Depth",
94 description="Cursor depth or solidify pattern",
95 maxlen=1,
96 default="D",
98 bpy.types.Scene.Key_BrushDepth: StringProperty(
99 name="Brush Depth",
100 description="Brush depth",
101 maxlen=1,
102 default="C",
104 bpy.types.Scene.Key_Subadd: StringProperty(
105 name="Add subdivision",
106 description="Add subdivision",
107 maxlen=1,
108 default="X",
110 bpy.types.Scene.Key_Subrem: StringProperty(
111 name="Remove subdivision",
112 description="Remove subdivision",
113 maxlen=1,
114 default="W",
116 bpy.types.Scene.Key_Randrot: StringProperty(
117 name="Random rotation",
118 description="Random rotation",
119 maxlen=1,
120 default="R",
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
130 layout = self.layout
131 print("DRAW !")
133 icon_1 = "TRIA_RIGHT" if not self.Enable_Tab_01 else "TRIA_DOWN"
134 box = layout.box()
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",
140 icon="LAYER_USED")
141 box.label(text="To finish carving press [ESC] or [RIGHT CLICK]",
142 icon="LAYER_USED")
143 box.prop(scene, "ProfilePrefix", text="Profile prefix")
145 icon_2 = "TRIA_RIGHT" if not self.Enable_Tab_02 else "TRIA_DOWN"
146 box = layout.box()
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)
150 box = split.box()
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="")
161 box = split.box()
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="")
172 box = split.box()
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="")
183 box = split.box()
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="")
194 def register():
195 bpy.utils.register_class(CarverPrefs)
197 def unregister():
198 bpy.utils.unregister_class(CarverPrefs)