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