14
$\begingroup$

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]
$\endgroup$
14
$\begingroup$

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

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

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

$\endgroup$
  • $\begingroup$ 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). $\endgroup$ – ColourModeller May 8 '16 at 9:17
  • 2
    $\begingroup$ Why not layer the objects you want to disappear, and composite them with z combine node. Then simply animate that as a switch? $\endgroup$ – 3pointedit May 8 '16 at 12:03
  • 1
    $\begingroup$ What are you talking about? Not easily possible to animate the visibility of objects? Just select the objects and alt-toggle the property. $\endgroup$ – Xtremity May 8 '16 at 13:30
  • $\begingroup$ @ColourModeller I think it would be useful if you posted this as a new question. $\endgroup$ – cegaton May 8 '16 at 15:05
  • $\begingroup$ 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. $\endgroup$ – ColourModeller May 11 '16 at 1:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy