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
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