ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Allard RothengatterCheck if there are any (visible) layers at the current time
by on Jul 2, 2015 at 12:54:33 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


Return to posts index

Dave LaRondeRe: Check if there are any (visible) layers at the current time
by on Jul 2, 2015 at 3:33:06 pm

Would you also need to take the duration of transitions of various sorts into account?

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Allard RothengatterRe: Check if there are any (visible) layers at the current time
by on Jul 2, 2015 at 3:38:58 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!


Return to posts index


Walter SoykaRe: Check if there are any (visible) layers at the current time
by on Jul 2, 2015 at 6:42:19 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 [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Allard RothengatterRe: Check if there are any (visible) layers at the current time
by on Jul 3, 2015 at 8:24:36 am

HI Walter,

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

Thanks.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]