]> git.tdb.fi Git - libs/gl.git/commitdiff
Take material diffuse intensity into account
authorMikko Rasa <tdb@tdb.fi>
Mon, 15 Sep 2014 08:24:46 +0000 (11:24 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 15 Sep 2014 08:24:46 +0000 (11:24 +0300)
blender/io_mspgl/export_object.py

index a8af6d1f9b6a87e2334fa4deeafe74062c66821c..0de98f8446a609692ccd527f8aeddc1bcd599da4 100644 (file)
@@ -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)