]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/export_light.py
Add a property in Blender for a custom shadow shader
[libs/gl.git] / blender / io_mspgl / export_light.py
index cfa4a19dadef5e2d859233dd1db477b054e46e61..4da2ba29a717c6b7bf6ac9417d4157b4ddc12302 100644 (file)
@@ -3,7 +3,7 @@ import mathutils
 class LightExporter:
        def export_light(self, obj):
                if obj.type!='LIGHT':
-                       raise ValueError("Object is not a light")
+                       raise ValueError("Object {} is not a light".format(obj.name))
                light = obj.data
 
                from .datafile import Resource, Statement
@@ -15,8 +15,7 @@ class LightExporter:
                        pos = obj.matrix_world@mathutils.Vector((0.0, 0.0, 0.0, 1.0))
 
                light_res.statements.append(Statement("position", *tuple(pos)))
-               c = light.color
-               e = light.energy
-               light_res.statements.append(Statement("color", c.r*e, c.g*e, c.b*e))
+               c = light.color*light.energy
+               light_res.statements.append(Statement("color", *tuple(c)))
 
                return light_res