-
Using sourceRectAtTime(); to link two boxes together
I have 4 layers that make up a lower third.
Name, Title, Name Box, Title BoxIn Name Box, under contents>rectangle 1>rectangle Path 1>Size I have this expression:
title=thisComp.layer(“NAME”).sourceRectAtTime();
L=effect(“Length”)(“Slider”);
H=effect(“Height”)(“Slider”);
[title.width+L, title.height+H](the sliders are there to give padding around the text)
Under contents>rectangle 1>rectangle Path 1>Position I have this expression:
content(“Rectangle 1”).content(“Rectangle Path 1”).size/2(This is to keep things left aligned)
The Title Box has the same expressions, but referencing the layer “title” instead of “name.”
What I’m trying to do is link the position of Title Box to the Name Box so that as the Name Box gets taller or shorter, the Title Box will remain the same distance from the Name Box.
What expression can I use to do this?I know I need to use sourceRectAtTime to find the height of the first box and somehow tell the