Update to CMake, tweaks & dds
[convexer.git] / config.py
1 # Convexer default configuration .py
2 #
3 # config dict purpose
4 # ------------------------------------------------------------------------------
5 # cxr_shaders Defines shader names
6 # cxr_graph_mapping Contains a graph to traverse Blender shader nodes
7 # cxr_shader_params Material shader properties and groups
8 # cxr_entities Entity info
9
10 # Shader names
11 #
12 cxr_shaders = \
13 {
14 "LightMappedGeneric": { "name": "Light Mapped" },
15 "VertexLitGeneric": { "name": "Vertex Lit" },
16 "UnlitGeneric": { "name": "Unlit" },
17 "Builtin": { "name": "Builtin" }
18 }
19
20 # Shader graph mapping
21 # ------------------------------------------------------------------------------
22
23 def material_tex_image(v):
24 return {
25 "ShaderNodeTexImage":
26 {
27 "image": F"${v}"
28 }
29 }
30
31 cxr_graph_mapping = \
32 {
33 "ShaderNodeBsdfPrincipled":
34 {
35 "Base Color":
36 {
37 "ShaderNodeMixRGB":
38 {
39 "Color1": material_tex_image("basetexture"),
40 "Color2": material_tex_image("decaltexture")
41 },
42 "ShaderNodeTexImage":
43 {
44 "image":"$basetexture"
45 },
46 "default":
47 [("VertexLitGeneric","$color2"),\
48 ("UnlitGeneric","$color2"),\
49 ("LightMappedGeneric","$color")]
50 },
51 "Normal":
52 {
53 "ShaderNodeNormalMap":
54 {
55 "Color": material_tex_image("bumpmap")
56 }
57 }
58 }
59 }
60
61 # Shader keyvalues / material properties
62 # ------------------------------------------------------------------------------
63
64 cxr_shader_params = \
65 {
66 "Textures":
67 {
68 "type": "ui",
69 "shaders": ("UnlitGeneric","VertexLitGeneric","LightMappedGeneric"),
70
71 "$basetexture":
72 {
73 "name": "Base Texture",
74 "type": "intrinsic",
75 "default": None
76 },
77 "$decaltexture":
78 {
79 "name": "Decal Texture",
80 "type": "intrinsic",
81 "default": None,
82
83 "$decalblendmode":
84 {
85 "name": "Blend Mode",
86 "type": "enum",
87 "items": [
88 ('0',"AlphaOver","Default",'',0),
89 ('1',"Multiply","",'',1),
90 ('2',"Modulate","",'',2),
91 ('3',"Additive","",'',3)
92 ],
93 "default": 0,
94 "always": True
95 }
96 },
97 "$bumpmap":
98 {
99 "name": "Normal Map",
100 "type": "intrinsic",
101 "flags": NBVTF_TEXTUREFLAGS_NORMAL, # OpenGL (correct) normal maps.
102 "default": None
103 }
104 },
105 "$color":
106 {
107 "name": "Color",
108 "type": "intrinsic",
109 "default": None,
110 "exponent": 1.0
111 },
112 "$color2":
113 {
114 "name": "Color2",
115 "type": "intrinsic",
116 "default": None,
117 "exponent": 1.0
118 },
119 "Lighting":
120 {
121 "type": "ui",
122 "shaders": ("VertexLitGeneric", "LightMappedGeneric"),
123
124 "$phong":
125 {
126 "name": "Phong",
127 "type": "bool",
128 "default": False,
129
130 "$phongexponent":
131 {
132 "name": "Exponent",
133 "type": "float",
134 "default": 5.0
135 },
136 "$phongboost":
137 {
138 "name": "Boost",
139 "type": "float",
140 "default": 1.0
141 },
142 "$phongfresnelranges":
143 {
144 "name": "Fresnel Ranges",
145 "type": "vector",
146 "default":(1.0,1.0,1.0)
147 },
148 "$basemapalphaphongmask":
149 {
150 "name": "Base alpha mask",
151 "type": "bool",
152 "default": False
153 }
154 },
155 "$envmap":
156 {
157 "name": "Cubemap",
158 "type": "string",
159 "default": "",
160
161 "$envmaptint":
162 {
163 "name": "Tint",
164 "type": "vector",
165 "subtype": 'COLOR',
166 "default": (1.0,1.0,1.0)
167 },
168 "$envmaplightscale":
169 {
170 "name": "Light Scale",
171 "type": "float",
172 "default": 0.0
173 },
174 "$envmaplightscaleminmax":
175 {
176 "name": "Min/Max",
177 "type": "vector",
178 "default": (0.0,1.0)
179 },
180 "$normalmapalphaenvmapmask":
181 {
182 "name": "Normal map mask",
183 "type": "bool",
184 "default": False
185 },
186 "$basealphaenvmapmask":
187 {
188 "name": "Base map mask",
189 "type": "bool",
190 "default": False
191 }
192 },
193 "$selfillum":
194 {
195 "name": "Emission",
196 "type": "bool",
197 "default": False
198 }
199 },
200 "Transparency":
201 {
202 "type": "ui",
203 "shaders": ("UnlitGeneric","VertexLitGeneric","LightMappedGeneric"),
204
205 "$translucent":
206 {
207 "name": "Translucent",
208 "type": "bool",
209 "default": False,
210
211 "$additive":
212 {
213 "name": "Additive",
214 "type": "bool",
215 "default": False
216 }
217 },
218 "$alphatest":
219 {
220 "name": "Alpha Test",
221 "type": "bool",
222 "default": False,
223
224 "$alphatestreference":
225 {
226 "name": "Step",
227 "type": "float",
228 "default": 0.5
229 }
230 },
231 "$nocull":
232 {
233 "name": "No Cull",
234 "type": "bool",
235 "default": False
236 }
237 },
238 "$surfaceprop":
239 {
240 "name": "Surface",
241 "type": "string",
242 "default": ""
243 }
244 }
245
246 # Entity KV definitions
247 # Note: currently blender doesnt support enum or bool types for IDProperties,
248 # so unfortunately the panel UI is a little bit bad to work with.
249 # ------------------------------------------------------------------------------
250
251 cxr_entities = \
252 {
253 # Builtin/intrinsic entities, you probably dont want to modify these
254 "light": { "keyvalues": ent_lights },
255 "light_spot": { "keyvalues": ent_lights },
256 "light_environment": { "keyvalues": ent_lights },
257 "env_cubemap": { "keyvalues": ent_cubemap },
258 "prop_static": { "keyvalues": ent_prop },
259 "sky_camera": { "keyvalues": ent_sky_camera },
260
261 # CSGO.fgd
262 # --------
263 "info_player_counterterrorist":
264 {
265 "gizmo": [],
266 "allow": ('EMPTY',),
267 "keyvalues": cxr_baseclass([ent_transform],\
268 {
269 "priority": {"type": "int", "default": 0 },
270 "enabled": {"type": "int", "default": 1 },
271 })
272 },
273 "info_player_terrorist":
274 {
275 "gizmo": [],
276 "allow": ('EMPTY',),
277 "keyvalues": cxr_baseclass([ent_transform],\
278 {
279 "priority": {"type": "int", "default": 0 },
280 "enabled": {"type": "int", "default": 1 },
281 })
282 },
283
284 # Brush entites
285 # -------------
286 "func_buyzone":
287 {
288 "allow": ('MESH',),
289 "keyvalues":
290 {
291 "TeamNum": {"type": "int", "default": 0 }
292 }
293 },
294 "func_bomb_target":
295 {
296 "allow": ('MESH',),
297 "keyvalues": {}
298 },
299 "func_detail":
300 {
301 "allow": ('MESH',),
302 "keyvalues": {}
303 },
304 "trigger_hurt":
305 {
306 "allow": ('MESH',),
307 "keyvalues":
308 {
309 "damage": { "type":"int", "default": 10},
310 "damagecap": { "type":"int", "default": 20},
311 "damagetype": { "type":"int", "default": 0},
312 "damagemodel": { "type":"int", "default": 0},
313 "damagetype": {"type":"int","default":0},
314 "nodmgforce": {"type":"int","default":0},
315 "spawnflags": {"type":"int","default":4097},
316 "StartDisabled": {"type":"int","default":0}
317 }
318 },
319 "env_soundscape":
320 {
321 "allow": ('EMPTY',),
322 "keyvalues": ent_soundscape
323 }
324 }
325
326 cxr_visgroups = ['layout','overlap','remove','cover','user0','user1','user2','user3']