Skip to main content
Participating Frequently
February 13, 2023
Répondu

Keeping subheading same distance from text

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.

Ce sujet a été fermé aux réponses.
Meilleure réponse par Mylenium

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

2 commentaires

Mylenium
MyleniumRéponse
Legend
February 14, 2023

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

Participating Frequently
February 14, 2023

Great, I'll try that @Mylenium Thanks for your help.

Mylenium
Legend
February 13, 2023

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

Participating Frequently
February 13, 2023

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.