From 4fb7f344efbf1899cfc5d1dbcfc3d8c49c91600a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 15 Sep 2014 11:24:46 +0300 Subject: [PATCH] Take material diffuse intensity into account --- blender/io_mspgl/export_object.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blender/io_mspgl/export_object.py b/blender/io_mspgl/export_object.py index a8af6d1f..0de98f84 100644 --- a/blender/io_mspgl/export_object.py +++ b/blender/io_mspgl/export_object.py @@ -82,7 +82,7 @@ class ObjectExporter: 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) @@ -96,7 +96,7 @@ class ObjectExporter: 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) -- 2.43.0