Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Check if there are any (visible) layers at the current time

  • Check if there are any (visible) layers at the current time

    Posted by Allard Rothengatter on July 2, 2015 at 12:54 pm

    Hey guys,

    I have a question. In order to slightly automate specific animations of an overlay appearing and disappearing in my main timeline, I would like to script the animation based on whether there is a layer displaying something at the current time. This way, if I add a new layer with to the comp, my main timeline would automatically animate the comp in at the starttime of the layer and animate out at the endtime of the layer.

    Furthermore, if there are overlapping layers, it should just animate out as soon as no more elements are active on the timeline.

    Below I made a small representation of a timeline with some layers

    Animate: In Out In Out In Out
    Layer 4:------|------|--------|---------------|--------|----[#######]---
    Layer 3:------|------|--------|---------------|--------[######]---------
    Layer 2:------|------|--------[###############]-------------------------
    Layer 1:------[######]--------------------------------------------------

    Anyone with a nifty way on how to detect if there’s anything to show at the current time thoughout all layers in the comp?

    Cheers,
    Allard

    Allard Rothengatter replied 10 years, 10 months ago 2 Members · 3 Replies
  • 3 Replies
  • Allard Rothengatter

    July 2, 2015 at 3:38 pm

    That is of less inportance as long as I can detect the “out” moment of the element(s).
    It might come in handy though.

    Thanks!

  • Walter Soyka

    July 2, 2015 at 6:42 pm

    You can loop through all layers in the comp and check to see if the current time is in between their in and out points. You can compare this with the in and out points of the current layer and your desired transition length and adjust accordingly.

    Note that with a lot of layers, evaluation of this expression will slow down.

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Allard Rothengatter

    July 3, 2015 at 8:24 am

    HI Walter,

    Sounds like a usable solution. Will give this one a shot.

    Thanks.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy