Skip to main content
m_Three
Participant
June 8, 2014
Answered

How to delay opacity following another layer

  • June 8, 2014
  • 1 reply
  • 3167 views

Hello All.

I have 100+ layers that I would like to fade on in a delayed fashion following the manual opacity key frames set in a 'master' layer. Thus, each of the 100+ layers will incrementally fade on by half a second — after the 'master' layer has faded in.

My research has led me to this expression:

thisComp.layer("leader").transform.opacity.valueAtTime(time-thisComp.frameDuration)

however the above fades in all 100+ layers simultaneously. I'd like the layers to fade in one after the other.

Can anyone suggest the script to make this happen please?

This topic has been closed for replies.
Correct answer Dan Ebberts

Assuming that the leader layer is layer #1, something like this should work:

delay = (index-1)*thisComp.frameDuration;

thisComp.layer("leader").transform.opacity.valueAtTime(time-delay);

This will give layer 2 a 1-frame delay, layer 3 a 2-frame delay, etc. If you wanted to increase the incremental delay to say, 3 frames, you could just change the first line to:

delay = 3*(index-1)*thisComp.frameDuration;

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
June 8, 2014

Assuming that the leader layer is layer #1, something like this should work:

delay = (index-1)*thisComp.frameDuration;

thisComp.layer("leader").transform.opacity.valueAtTime(time-delay);

This will give layer 2 a 1-frame delay, layer 3 a 2-frame delay, etc. If you wanted to increase the incremental delay to say, 3 frames, you could just change the first line to:

delay = 3*(index-1)*thisComp.frameDuration;

Dan

m_Three
m_ThreeAuthor
Participant
June 8, 2014

Mr. Ebberts… may you live for a 1000 years.

I thank you very much for the solution and the extra tip. It works as described!