Script point light strength in cycles I'm working on a project and I want to have a script tell a point light to change intensity at certain times.
What I'm confused about is how to do that in cycles - the sidebar data tab says it uses nodes but I can't find where those output to? When I try light_object.active_material it returns an error saying it doesn't have that attribute. Is there some other way I'm not seeing?
Edit - I was looking in the data.lamps group and I changed to data.objects and now it's not returning an error, but it says there's no active material even though there is?
You can do this by adding an event handler to the frame change event.

import bpy

def my_handler(scene):

    fm = bpy.data.scenes['Scene'].frame_current

    if fm &gt;= 1:
        lampStrength = 100
    if fm &gt;= 50:
        lampStrength = 200
    if fm &gt;= 100:
        lampStrength = 300
    if fm &gt;= 150:
        lampStrength = 400                

    scene.objects['Point'].data.node_tree.nodes['Emission'].inputs['Strength'].default_value=lampStrength

    print("lamp strength: " + str(lampStrength))


def register():
    bpy.app.handlers.frame_change_post.append(my_handler)

def unregister():
    bpy.app.handlers.frame_change_post.remove(my_handler)

if __name__ == "__main__":
    register()    


Credit for frame change portion of script here: Running a script for each frame