Copy link to clipboard
Copied
Hello all. I have a MOGRT template made that allows people to change the Main Heading on an Intro and also the Subheading (as you can see on the image). What I am trying to do in AE is ensure the Subheading sticks to the same distance away from the Main Heading wether someone changes the text 2 lines or 4 lines in Premier.
Hope Ive made sense. As always thanks in advance.
You simply add whatever values you want to the position of the subheadline. Example:
mHead=thisComp.layer("Heading");
mPos=mHead.transform.position;
mDist=mHead.sourceRectAtTime().height;
mPad=30;
X=mPos[0];
Y=mPos[1]+mDist+mPad;
[X,Y]
Mylenium
Copy link to clipboard
Copied
The usual solutions involving sourceRectAtTime() will sufficiently do the trick. Here's a tutorial and there are a million others:
https://www.youtube.com/watch?v=In4miXUdxko
Mylenium
Copy link to clipboard
Copied
Thanks for the quick reply @Mylenium I was looking at this to make an invisible box around the text as psuedo padding, but how can I link the subtitle text to that Main text to ensure it stays the same distance away when someone changes the text? I was thinking, can I lock it to the bottom of the psuedo box? I can't work out how to do that or is there a more obvious way.
Copy link to clipboard
Copied
You simply add whatever values you want to the position of the subheadline. Example:
mHead=thisComp.layer("Heading");
mPos=mHead.transform.position;
mDist=mHead.sourceRectAtTime().height;
mPad=30;
X=mPos[0];
Y=mPos[1]+mDist+mPad;
[X,Y]
Mylenium
Copy link to clipboard
Copied
Great, I'll try that @Mylenium Thanks for your help.
Copy link to clipboard
Copied
This worked a treat. Thank you!