out_file.write("storage", "RGB", len(mesh.materials), 1)
texdata = '"'
for m in mesh.materials:
- color = [int(cm(c)*255) for c in m.diffuse_color]
+ color = [int(cm(c)*255) for c in m.diffuse_color*mat.diffuse_intensity]
texdata += "\\x%02X\\x%02X\\x%02X"%tuple(color)
texdata += '"'
out_file.write("raw_data", texdata)
amb = cm(mat.ambient)
out_file.write("ambient", amb, amb, amb, 1.0)
else:
- diff = mat.diffuse_color
+ diff = mat.diffuse_color*mat.diffuse_intensity
out_file.write("diffuse", cm(diff.r), cm(diff.g), cm(diff.b), 1.0)
amb = diff*mat.ambient
out_file.write("ambient", cm(amb.r), cm(amb.g), cm(amb.b), 1.0)