-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathluxfilegeneration.py
47 lines (37 loc) · 1.18 KB
/
luxfilegeneration.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import math
w = open('materials-geometry.lxo', 'w')
materials = [['glass'],
['glossy'],
['matte'],
['mirror'],
['roughglass']
]
carpaints = ['ford f8','polaris silber','opel titan','bmw339',
'2k acrylack','white','blue','blue matte']
metals = ['amorphous carbon','silver','gold','copper','aluminium']
for cp in carpaints:
materials.append(['carpaint', '\"string name\" \"' + cp + '\"'],)
for m in metals:
materials.append(['metal', '\"string name\" \"' + m + '\"'],)
models = ['Shape \"plymesh\" \"string filename\" [\"luxball3-outer.ply\"]',
'Shape \"plymesh\" \"string filename\" [\"luxball3-inner.ply\"]']
length = len(materials)
side = int(math.ceil(math.sqrt(length)))
print side
x = 2.0
y = 2.0
for mat in materials:
w.write("AttributeBegin\n")
w.write("Translate " + str(x) + " " + str(y) + " 0.0\n")
w.write("Scale 20 20 20\n")
w.write("Material \"" + mat[0] + "\"\n")
if len(mat) > 1:
w.write(mat[1] + "\n")
for mod in models:
w.write(mod + "\n")
w.write("AttributeEnd\n\n")
if x < 12.0:
x += 3.0
else:
x = 2.0
y += 3.0