Skip to main content
Participant
May 14, 2020
Question

I need to control keyframe by width of other text layer in after effects expressions

  • May 14, 2020
  • 1 reply
  • 470 views

Hi I am trying to make a tempalte in Ae that slises in, so I need that the width of the rectangle will be the same of the text layer that above the box layer. but the rectangle have a slider effect so, i want to do something like this:

at 0 frames the slider is on 0, an after 30 fremes(1s) the slider will be the width of the text layer. 

and i want it to be like animation but i don't know how to do this, i am trying to do this for 3 days.

please awnser fast.

This topic has been closed for replies.

1 reply

Mylenium
Legend
May 14, 2020

Don't animate the path directly. Instead create a "Completion" or "Expansion" Slider with a percent range. this can then drive the actual rectangle. Something like this might work:

 

mComp=thisComp.layer("XYZ").effec("Completion")("Slider"); //layer with slider

mStart=0; //start frame
mEnd=30; //end frame

mSize=thisComp.layer("Text").sourceRectAtTime(framesToTime(mEnd));

mX=linear(mComp,0,100,0,mSize[0]);
mY=mSize[1];

[X,Y]

 

Mylenium

zivbehAuthor
Participant
May 14, 2020

Thank you for your quick response!

but here 

mSize[0])

Ae doesn't know what '0' means.