How to animate layers in Blender 2.6 I remember being able to animate layers using keyframes in some previous Blender release.

Now if I try to add a keyframe to an object layer I get the following error message :

"layers" property cannot be animated


I have the following code which can change the layer, but it's not really useful, I would like to have it in an animation, so I can reuse it. 

bpy.data.objects['Cube'].layers = [False, True, False, False, False, False, False,False,False,False,False,False,False,False,False,False,False,False,False,False]
From information in a BlenderArtists thread, keyframing object layer is not a developer-approved way to animate visibility, and is now deliberately disabled.

If what you really want to animate is visibility, you can keyframe the object's Restrict Render property directly  in the outliner space, by moving the mouse above the camera icon and pressing I.