callbacks.removescripts id:#softLight
txt = "s = $Spot01 \n"
txt += "helix_path = helix radius1:20 radius2:0 height:0 turns:5\n"
txt += "helix_path.pos = s.pos\n"
txt += "helix_path.transform.controller = lookat() \n"
txt += "helix_path.lookat = copy s.target \n"
txt += "helix_path.name = uniquename \"SoftLight_Temp\"  \n"
txt += "helix_path.parent = s  \n"
txt += "num_lights = 42 \n"
txt += "for i = 1 to num_lights do  \n"
txt += "( \n"
txt += "new_light = copy s \n"
txt += "new_target = copy s.target \n"
txt += "new_light.target = new_target  \n"
txt += "new_light.multiplier = s.multiplier / num_lights \n"
txt += "new_light.name = uniquename \"SoftLight_Temp\"   \n"
txt += "new_light.pos.controller = path path:helix_path \n"
txt += "deleteKeys new_light.pos.controller.percent.keys #allkeys \n"
txt += "new_light.pos.controller.percent=(100.0*i/num_lights) \n"
txt += "new_light.raytracedShadows = s.raytracedShadows \n"
txt += "new_light.on = true \n"
txt += ") \n"
txt += "s.on = false \n"
callbacks.addScript #preRender txt id:#softLight persistent:true

txt ="delete $SoftLight_Temp*\n"
txt += "$Spot01.on = true\n"
callbacks.addScript #postRender txt id:#softLight persistent:true
