• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How do I link an animation to the duration of a layer?

New Here ,
Jun 26, 2023 Jun 26, 2023

Copy link to clipboard

Copied

Hi there,

I'm building a template for a client to embed social media videos into a main video. I want them to be able to drop the videos into precompostions and simply change the length of that composition. Then in the main composition I want the videos to scroll in and out of frame at the beginning and end of the composition. How can I "link" the position animation to the variable end of the precompositon, so they don't have to move the keyframes? So no matter how long the precomp ist, once it ends, the video will slide up?

(I hope I could explain this okay, English is not my first language)

Thank you for your help!

Lara

TOPICS
FAQ , How to

Views

116

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2023 Jun 26, 2023

Copy link to clipboard

Copied

LATEST

You have to set up an animation that uses the layer in-point and out-point as drivers for an interpolation method. Something like this:

 

y = thisComp.height/2;
Xstrt = - sourceRectAtTime().width/2;
Xmid = thisComp.width/2;
Xend = thisComp.width - Xstrt;
t = time - inPoint;
dur = .5;
if (t < dur){
	x = easeIn(t, 0, dur, Xstrt, Xmid);
}
else{
	x = easeOut(t, outPoint - dur, outPoint, Xmid, Xend);
}
[x, y]

 

That expression will give you a half-second slide in and slide out based on the layer in and put points. It will work with shape, text, or footage layers and comps as long as you don't scale the layers. If you need to scale the layers, you will need to throw in a scale multiplier for the start and end positions. The anchor point must be at the default middle of the layer position, and a text layer needs to be center justified unless you throw in a sourceRectAtTime.left value.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines