FORUMS: list search recent posts

Position based off right edge of shape

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Caleb Nix
Position based off right edge of shape
on Apr 28, 2020 at 4:43:52 pm

Hello all! I need help with some expressions inside of a lower third template I'm creating...

TL;DR: Looking for expression to animate center of shape from left edge to right edge of dynamic rectangles (responsive to length to text layer) before/at the same time as box's scale animates from [0,100] to [100,100]

--------

So I have both of my white textbox shape layers (Title Box & Secondary Box) using expressions to be responsive based off of the length of text on the Title Text Layer. Both Title Box and Secondary Box have an offset path (margins) and padding on the right side (room for animation); both of which are controlled independently with expression sliders.

I've been following a post from Adobe Community Support but that solution isn't working 100%.


I currently am using this expression on my Teardrop Shape Layer's position:

s=thisComp.layer("Title Text Layer")
x=s.sourceRectAtTime(time-s.inPoint,true).width;
[x, value[1]]


This works ok (it's not perfectly aligned but I'll take it at this point). The problem with this solution comes when the name is shorter or longer than X amount of characters.

Here is a gif of what I currently have. Again this solution only works with the current text. When a shorter or larger name is added, the shape doesn't align anymore.

So I guess my question is: Is there an expression (or group of expressions rather) to find the x value of Title Box at the middle of a sequence { mid=(end-start)/2} and apply that value to the ending position of Teardrop Shape while still having everything scale width-wise if a shorter or longer name is added?


Thanks!

Caleb


Return to posts index

Walter Soyka
Re: Position based off right edge of shape
on Apr 28, 2020 at 6:54:29 pm

This expression will return the position, in 2D comp space, of the top-right corner of the referenced shape layer:

l = thisComp.layer("My Awesome Shape Layer");
l.toComp([l.sourceRectAtTime(time).left + l.sourceRectAtTime(time).width, l.sourceRectAtTime(time).top]);


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

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