The goal is to change the hue of objects based on the difference between the frame when the object is made visible to the scene renderer and the frame_current. What code will allow me to access the frame number of an object's visibility keyframe? Something like:
import bpy objs=bpy.data.objects[0:-3] #select multitude of objects barring a camera, # light, and curve scene=bpy.context.scene endF=scene.frame_end currentF=scene.frame_current while currentF != endF: for o in objs: start=o.visible.frame # <-?? #set variable for the frame number # when each object is made visible hue=o.material.diffuse.color #set variable for hue of object's # material #set hue based on difference between current frame and visible frame if currentF-start==1: hue=0x6E00E7
The line of code I really need help with is marked with "# <-??", i.e., line 12.
Solved. It works now.
import bpy objs=bpy.data.objects #make list of all objects in scene scene=bpy.context.scene endF=scene.frame_end currentF=scene.frame_current keyframes= meshObs= for o in objs: if o.type == 'MESH' and o.animation_data !=None: fc = o.animation_data.action.fcurves.find('hide') keyframes.append([kfp.co for kfp in fc.keyframe_points if kfp.co==0]) meshObs.append(o)