-
Expression help for lower third underline
As you can tell my under line is not center with my text.
My text is right aligned and the tracking animates.
The underline has the anchor point set to the right corner.
The underline layer is parented to the text layer.
As the text moves to the left the underline grows from the center instead of the right and this is somehow throwing off the underline..
How can I modify my expression to so that the underline grows only from the right and does not bleed into the title safe margin?
Here is the code I’m using:
// Paste this to ShapePath -> Size
margin = 50;
text_width = thisComp.layer(“Text”).sourceRectAtTime().width;
text_height = thisComp.layer(“Text”).sourceRectAtTime().height;
box_width = text_width + margin*2;
box_height = text_height + margin*2;
[box_width, box_height]
// Paste this to ShapePath -> Position
text_height = thisComp.layer(“Text”).sourceRectAtTime().height;
[0, text_height/2]
// Paste this to Shape->Transform->Positon
t = thisComp.layer(“Text”);
tRect = t.sourceRectAtTime(time,false);
tUL = t.toComp([tRect.left,tRect.top]);
tLR = t.toComp([tRect.left+tRect.width,tRect.top+tRect.height]);
tCenter = (tUL + tLR)/10
myRect = sourceRectAtTime(time,false);
myUL = toComp([myRect.left,myRect.top]);
myLR = toComp([myRect.left+myRect.width,myRect.top+myRect.height]);
myCenter = (myUL + myLR)/10
delta = myCenter – tCenter;
value – delta