# 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.

• I just went to the same conclusion a couple of minutes ago. Render visibility is really the way to do it. – user471 Jun 14 '13 at 18:47
• Note, if you really want you could change the layers in a frame change handler still (from python). – ideasman42 Jun 15 '13 at 0:45
• You should mention that the mouse needs to be over this icon (your answer doesn't make that very clear). – A Wild RolandiXor Feb 3 '15 at 14:48

It is probably helpful for future readers to know that Version 2.77a (and probably other versions, including 2.6) prevents the animation of the 'Restrict Render' property (and 'Viewport Visibility') for groups, unless you animate each individual object in the group, one at a time.

At the time of writing, the animation of the visibility of groups of thousands of objects (with various materials) is not easily or practically possible.

[This answer would have been a comment if I were allowed to post them. I'm new here and not yet allowed to comment on these posts.]

• Currently, I suspect that the only practical solution to make multiple various objects (especially hundreds or more) suddenly appear, is to animate their location from somewhere off-camera between two consecutive frames (to avoid tweening). – ColourModeller May 8 '16 at 9:17
• Why not layer the objects you want to disappear, and composite them with z combine node. Then simply animate that as a switch? – 3pointedit May 8 '16 at 12:03
• What are you talking about? Not easily possible to animate the visibility of objects? Just select the objects and alt-toggle the property. – Xtremity May 8 '16 at 13:30
• @ColourModeller I think it would be useful if you posted this as a new question. – user1853 May 8 '16 at 15:05
• Thanks for the replies. I'll consider posting this topic as a separate question. I just want to quickly report that my suspected solution (above) also does not seem to work. Only one object in the group gets animated. It seems impossible to animate the visibility of many objects (hundreds or more with various materials) in Blender. It's surprising that the visibility/rendering of groups can't be keyframed (at least at the time of Blender Version 2.77a). I hope it will be changed ASAP. – ColourModeller May 11 '16 at 1:55