14

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]

2 Answers2

14

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.

enter image description here

Adhi
  • 14,310
  • 1
  • 55
  • 62
0

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 08 '16 at 09:17
  • 2
    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 08 '16 at 12:03
  • 1
    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 08 '16 at 13:30
  • @ColourModeller I think it would be useful if you posted this as a new question. –  May 08 '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 01:55
  • @Xtremity, it is necessary to click and keyframe the property of each object individually, isn't it? – ColourModeller May 11 '16 at 01:55
  • @3pointedit, thanks. I'll look into that. – ColourModeller May 11 '16 at 01:56