Skip to main content
Known Participant
March 4, 2023
Answered

Is there an expression for dynamically changing the startpoint of a layer relative to a keyframe?

  • March 4, 2023
  • 1 reply
  • 371 views

Hello,

 

I have an audio layer that I'd like to start at the same time as the first keyframe of a mask path titled "Mask 1" on a layer titled "Mask Movement". However, the position in time of the keyframes of the mask path are set to change based on the outpoint of a different layer using the following expression:

target = thisComp.layer("Target Layer");
targetMask = target.mask("Particular Path").maskPath;
targetMask

 

In case it helps, the purpose of the audio layer automatically changing its start position is because I'm creating multiple renders that have varying timings, so it would help to automate the process.

 

Thank you!

 

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

Enable time remapping for your audio layer and then apply this time remapping expression:

t = thisComp.layer("Mask Movement").mask("Mask 1").maskPath.key(1).time;
valueAtTime(time - t)

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 4, 2023

Enable time remapping for your audio layer and then apply this time remapping expression:

t = thisComp.layer("Mask Movement").mask("Mask 1").maskPath.key(1).time;
valueAtTime(time - t)