Copy link to clipboard
Copied
Hey,
is there a way to check if a layer is visible at given time? I know about two methods:
.audioActiveAtTime() and .activeAtTime(time), which could be helpful, but rather than checking if layer is enabled I'd like to check if it is visible / hearable (regardless of .enalbed, .audioEnabled state).
Thanks in advance!
This may help spark an idea. Maybe.
Free Function Friday layersAtCurTime by David Torno - ProVideo Coalition
Copy link to clipboard
Copied
You've listed all possibilities. Yet it is still not clear why none of the methods suits your needs.
Copy link to clipboard
Copied
Are you talking about checking the layer property - Opacity ?
Hearable? Checking the audio levels property value but that would depend on each audio file ?
If the layer is inactive at the current time, it's not there - so it can't be hearable or visible at that time.
Copy link to clipboard
Copied
If "enabled" is not good enough for you, you probably need to think about what you mean exactly with "visible".
You might think a layer is not visible, for example, when it is located somewhere behind the active camera, but it could still cast shadows, be used in effect parameters etc. and hence still have an influence on the resulting image.
Copy link to clipboard
Copied
Hmmm something that would tell me if a layer is active on TIMELINE at given time would be helpful enough. I need to check which layers are used/visible/hearable at given time.
Copy link to clipboard
Copied
What is the difference between activeAtTime() and being active on timeline at given time?
Copy link to clipboard
Copied
reading.!
Copy link to clipboard
Copied
This may help spark an idea. Maybe.
Free Function Friday layersAtCurTime by David Torno - ProVideo Coalition
Copy link to clipboard
Copied
Thanks!! Yes, I think this will be my base for that thing
Copy link to clipboard
Copied
does activeAtTime() concern main timeline time or parent comp timeline time? If first, is there a way to address main timeline time?
This for example is part of my timeline. I wrote a function, which returns that layer1 is active at given time, which is true. But also it returns, that few layers inside mainComps layer4 are active, which may be true if first part of my question is. Here's what it looks like inside comps starting with main comp:
Copy link to clipboard
Copied
when I check activeAtTime() of "kalenrzarz1" comp I get true for values 0 to 3.5, above is false. How is that corresponding to this timeline? I dont get it.
Copy link to clipboard
Copied
Yes, even though marker is set at 7:22 and layers starts at this moment (timeline marker on the picture) comp "kalendarz1".startTime returns 0
Is there a way to address general mainComps timeline instead ?
Copy link to clipboard
Copied
When the CTI (current time indicator) is at the very beginning of the comp, comp.time is 0, independantly of comp.displayStartTime
That's how it works.
Xavier
Copy link to clipboard
Copied
Ok, I've managed to overcome this. While looping I check if curComp.containingComp.name === myMainComp.name, if yes then I create var tempTime = givenTime - parentCompLayerInMainComp.inPoint and check myLayer.activeAtTime(tempTime)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now