Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sourceRectAtTime : how to make a transition between different text sizes ?

  • sourceRectAtTime : how to make a transition between different text sizes ?

    Posted by Sebastien Bruzzo on August 18, 2017 at 10:20 am

    Hello again, second question in a row :

    I’m using the very useful sourceRectAtTime to link a rectangle shape layer to the size of a text layer, BUT… I need to change the same rectangle box according to different text layers that will slide inside this rectangle box, and this has to be an animated transition (let’s say 10 frames).

    Thank you for your help !

    Andrei Popa replied 9 years ago 2 Members · 2 Replies
  • 2 Replies
  • Sebastien Bruzzo

    August 20, 2017 at 6:59 pm

    Anyone could give me a clue about this problem please ?

    I can answer any question if my explanation was not clear ☺

    Thanks !

  • Andrei Popa

    August 21, 2017 at 8:04 am

    Well. Baby steps. So you have a rectangle on a text layer. Then another text layer comes in and you want it to take the size of the new text? If so, you should use an ease function. Something like this

    dur = 0.33; //about ten frames, assuming that you are working on a 30 fps project
    easeStart = thisComp.layer("secondTextLayer").inPoint;
    easeEnd = easeStart + dur;
    startValue = [thisComp.layer("firstTextLayer").sourceRectAtTime(time,false).width,thisComp.layer("firstTextLayer").sourceRectAtTime(time,false).height]
    endValue = [thisComp.layer("secondTextLayer").sourceRectAtTime(time,false).width,thisComp.layer("secondTextLayer").sourceRectAtTime(time,false).height]
    if (time< easeStart) startValue else ease(time,easeStart,easeEnd,startValue,endValue);

    this is for 2 layers. If you have many, i would suggest arranging them one after another and using the index in a for loop. If you do have many layers and can’t figure this out, tell me and i will try to find a solution.

    Andrei

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy