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

How Do I Make An Expression For Topic List type

Community Beginner ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

ae.PNGHello, I was wondering how do you make an expression that each layer will automatically adjust its transform or spacing between the other layers. Also I keyframed the position of each layer because I want to fade in and moves up when called.
I'll have to convert them to MOGRT so it'll save me some time when I use it again.

 

 
TOPICS
Expressions , FAQ , How to

Views

276

Translate

Translate

Report

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

correct answers 1 Correct answer

LEGEND , May 07, 2021 May 07, 2021

Could be infinitely complicated, to be honest. Grabbing the bounding box using sourceRectAtTime() is easy as is adding trhe necessary padding, but things can quickly go crazy if you have multiple layers set up this way and interacting, especially when they are already animated. A lot of valueAtTime() stuff to adjust the keyframed positions. And whether all of this actually works correctly inside a MOGRT is another question. Not saying it's impossible, but it's not going to be trivial, either. An

...

Votes

Translate

Translate
LEGEND ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

Could be infinitely complicated, to be honest. Grabbing the bounding box using sourceRectAtTime() is easy as is adding trhe necessary padding, but things can quickly go crazy if you have multiple layers set up this way and interacting, especially when they are already animated. A lot of valueAtTime() stuff to adjust the keyframed positions. And whether all of this actually works correctly inside a MOGRT is another question. Not saying it's impossible, but it's not going to be trivial, either. Anyway, start by researching the usual "text box adapting to text length" tutorials and similar stuff to get an idea what challenges you are potentially facing.

 

Mylenium

Votes

Translate

Translate

Report

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 Beginner ,
May 07, 2021 May 07, 2021

Copy link to clipboard

Copied

LATEST

Hey Mylenium! sourceRectAtTime() works 🙂 sorry for not updating that I found the answer to it.
(sorry in advance if my grammar is a bit confusing to read especially mixing it with coding language)

What I did was adding an animator position to the text (didn't use transform position because I already had keyframed to move in) , so everytime I duplicate the layer, it would automatically go down and also move itself depending on the previous text.

 

var a = thisComp.layer(index-1); 
var b = a.sourceRectAtTime().height;
var c = thisComp.layer(index-1).text.animator("Animator 1").property.position[1];

[0,b+(c+thisComp.layer("Texts Spacing Controller").effect("Slider Control")("Slider"))]; // Added a slider to set values if how much spacing do I need between each text layers.

 

(Hope it made sense to think about it, cuz i dont know how to explain it)

 

 

Votes

Translate

Translate

Report

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