hero props
[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": 2.2
111 },
112 "$color2":
113 {
114 "name": "Color2",
115 "type": "intrinsic",
116 "default": None,
117 "exponent": 2.2
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 },
149 "$envmap":
150 {
151 "name": "Cubemap",
152 "type": "string",
153 "default": "",
154
155 "$envmaptint":
156 {
157 "name": "Tint",
158 "type": "vector",
159 "subtype": 'COLOR',
160 "default": (1.0,1.0,1.0)
161 },
162 "$envmaplightscale":
163 {
164 "name": "Light Scale",
165 "type": "float",
166 "default": 0.0
167 },
168 "$envmaplightscaleminmax":
169 {
170 "name": "Min/Max",
171 "type": "vector",
172 "default": (0.0,1.0)
173 }
174 }
175 },
176 "Transparency":
177 {
178 "type": "ui",
179 "shaders": ("UnlitGeneric","VertexLitGeneric","LightMappedGeneric"),
180
181 "$translucent":
182 {
183 "name": "Translucent",
184 "type": "bool",
185 "default": False
186 },
187 "$alphatest":
188 {
189 "name": "Alpha Test",
190 "type": "bool",
191 "default": False,
192
193 "$alphatestreference":
194 {
195 "name": "Step",
196 "type": "float",
197 "default": 0.5
198 }
199 },
200 "$nocull":
201 {
202 "name": "No Cull",
203 "type": "bool",
204 "default": False
205 }
206 }
207 }
208
209 # Entity KV definitions
210 # Note: currently blender doesnt support enum or bool types for IDProperties,
211 # so unfortunately the panel UI is a little bit bad to work with.
212 # ------------------------------------------------------------------------------
213
214 cxr_entities = \
215 {
216 # Builtin/intrinsic entities, you probably dont want to modify these
217 "light": { "keyvalues": ent_lights },
218 "light_spot": { "keyvalues": ent_lights },
219 "env_cubemap": { "keyvalues": ent_cubemap },
220 "prop_static": { "keyvalues": ent_prop },
221
222 # CSGO.fgd
223 # --------
224 "info_player_counterterrorist":
225 {
226 "gizmo": [],
227 "allow": ('EMPTY',),
228 "keyvalues": cxr_baseclass([ent_transform],\
229 {
230 "priority": {"type": "int", "default": 0 },
231 "enabled": {"type": "int", "default": 1 },
232 })
233 },
234 "info_player_terrorist":
235 {
236 "gizmo": [],
237 "allow": ('EMPTY',),
238 "keyvalues": cxr_baseclass([ent_transform],\
239 {
240 "priority": {"type": "int", "default": 0 },
241 "enabled": {"type": "int", "default": 1 },
242 })
243 },
244
245 # Brush entites
246 # -------------
247 "func_buyzone":
248 {
249 "allow": ('MESH',),
250 "keyvalues":
251 {
252 "TeamNum": {"type": "int", "default": 0 }
253 }
254 }
255 }