ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Link punctuation layers to text, and then animating with two values

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tyler Jack
Link punctuation layers to text, and then animating with two values
on Mar 24, 2020 at 2:22:37 pm

Hey there.

I'm animating a quote, where the quotation marks scale up centrally and then animate apart, perfectly landing at the start / end of my linked text layer. I've used the following expression (my bounding box matches the size of the text and the quotation marks are set to the left / left + width)

x=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).left +
thisComp.layer("Bounding Box").transform.position[0] +
thisComp.layer("Bounding Box").sourceRectAtTime().width + 16;
y=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).top +
thisComp.layer("Bounding Box").transform.position[1];
[x,y]

Is there a way in which this above code can be made as a B value, with an A value as the central 960, 540. I've been trying to use

linear(thisLayer.effect("Slider Control")("Slider"), 0, 100, value, value)

and then somehow define my two values.

Any help would be appreciated - even if it it's to tell me this isn't possible. I'm working up a template and in an ideal world it would be fully reactive to any changes in the main text layer.

Thanks,
TJ


Return to posts index

Andrei Popa
Re: Link punctuation layers to text, and then animating with two values
on Mar 26, 2020 at 7:56:05 am

I hope I understood you right. But this will only work on one-line texts. Or perfectly justified, because if the last line is shorter, the quote will be at the end of the entire paragraph.

x=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).left +
thisComp.layer("Bounding Box").transform.position[0] +
thisComp.layer("Bounding Box").sourceRectAtTime().width + 16;
y=thisComp.layer("Bounding Box").sourceRectAtTime(time,true).top +
thisComp.layer("Bounding Box").transform.position[1];
B = [x,y];
A = [960, 540];
linear(thisLayer.effect("Slider Control")("Slider"), 0, 100, A, B);


Andrei
My Envato portfolio.


Return to posts index

Tyler Jack
Re: Link punctuation layers to text, and then animating with two values
on Mar 26, 2020 at 9:49:52 am

Thank you Andrei - this is exactly what I needed. It works perfectly.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]