Un-hardcode the light distance.

This commit is contained in:
Bill Currie 2012-09-03 14:34:27 +09:00
parent dfaf28001a
commit 125952d17d

View file

@ -69,6 +69,11 @@ def process_entity(ent):
name = classname
if "classname" in ent.d and ent.d["classname"][:5] == "light":
light = bpy.data.lamps.new("light", 'POINT')
if "light" in ent.d:
light.distance = float(ent.d["light"])
elif "_light" in ent.d:
light.distance = float(ent.d["_light"])
else:
light.distance = 300.0
light.falloff_type = 'CUSTOM_CURVE'
obj = bpy.data.objects.new(name, light)