Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MOGRT with 2 separate text boxes, 1 autoscaling shape, and 1 image pinned to corner of shape

New Here ,
Mar 25, 2025 Mar 25, 2025

Hello!

 

I’d say that I’m extremely inexperienced in After Effects, but I’ve been playing around a lot with .mogrt creation and expressions and I’ve run into a problem that has stumped me at every turn.

 

I’m trying to create a .mogrt file that contains:

  • 2 separate text boxes (both left justified, stacked one on top of the other) with different fonts and font sizes.
  • 1 autoscaling shape (box) that holds both text boxes.
  • 1 image pinned to the bottom right corner of the autoscaling shape.

 

Here are the current problems I can’t seem to figure out:

  • I am unable to get the image to move horizontally with the autoscaling box (it moves vertically just fine).
  • I am unable to get the two text boxes to stay stacked when both are empty; furthermore, the bottom box cuts into the top one when there is text in them.
  • The autoscaling shape does not recognize the second text box when changing size.

 

In basic terms, I can’t figure out how to keep the two text boxes in their own spaces and have the shape recognize both when autoscaling. I also can’t figure out how to keep the pinned image in the bottom right corner when the margins change horizontally. I don’t even know if I’m using the correct terms for any of this so any help would be greatly appreciated. I’ve watched a lot of tutorials and read a lot of these forums to get to this point but I’m sure these expressions are quite messy so please forgive my inexperience haha.

 

I’ll attach the project file along with all the expressions currently in use.

 

BG Shape Expressions:

Size:

s=thisComp.layer("Text");
t=thisComp.layer("Reference");
 
s_w=s.sourceRectAtTime().width*1.3;
s_h=s.sourceRectAtTime().height;
 
t_w=t.sourceRectAtTime().width*1.3;
t_h=t.sourceRectAtTime().height;
 
minScale = 1000;
currentScale = t_h;
transform.scale[0];
 
if (currentScale < minScale) {
s.transform.scale = minScale
} else {
s.transform.scale = currentScale
};
 
w=Math.max (s_w, t_w);
h= (s_h+t_h);
 
[w,h]
 
Text 1 Expressions
Anchor Point
s=sourceRectAtTime();[0,s.top-45+s.height/2]+value
 
Position
secondTxt = thisComp.layer("Text 1");
sSize = secondTxt.sourceRectAtTime();
vPad = +1055;
p = secondTxt.position;
s = secondTxt.scale * .01; t = sSize.top * s[1];
h = sSize.height * s[1];
w = sSize.width * s[0];
l = sSize.left * s[0];
 
src=thisLayer.sourceRectAtTime();
srcS = scale * .01;
srcT = src.top * srcS[1];
srcH = src.height * srcS[1];
srcW = src.width * srcS[0];
srcL = src.left * srcS[0];
 
x = p[0] + l + w - srcL - srcW - w + vPad;
y = p[1] + t + h - srcT - srcH;
 
[x, y]
 
Text 2 Expressions
Anchor Point
a = thisLayer.sourceRectAtTime(time, false);
[0, a.top + a.height]
 
NULL Expressions
Position
[thisComp.layer("Text 1").transform.position[0] + thisComp.layer("Text 1").sourceRectAtTime().width,
thisComp.layer("Text 1").transform.position[1] + thisComp.layer("Text 1").sourceRectAtTime().height / 2]
 
(Text 2 and the pinned image are both parented to the NULL)
 
Thanks everyone!!
TOPICS
How to
188
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2025 Mar 25, 2025

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 26, 2025 Mar 26, 2025
LATEST

I took a quick look at your project, and there are quite a few problems. The first is the Paragraph Text for the text layers. You cannot control the size or position of a text box with expressions. If you need a text box, you must ensure your text is left-justified. You also have some severe scaling and other things going on. 

 

I don't have time to dig through the whole comp and fix all the problems, but maybe the file I am sharing will help you figure things out. You have to consider the top, left, height, and width. You also tie the text layers to the main or top layers using position expressions. This project requires the same paragraph justification for all layers.

 

Take a look, and it should give you some guidance. The comp is part of a tutorial series I am working on that should give you all you need to know to create very complex MOGRTS and Animation Presets for text, shape, and even image layers using sourceRectAttime() to control and animate position and size.

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines