Skip to main content
JakobSjobom14249257
Known Participant
May 17, 2017
Answered

Row of text animation (y position gap for underlying layers) expression

  • May 17, 2017
  • 3 replies
  • 3707 views

Hi guys

So I´m creating cooking videos and want to present ingredients through animation (simple position x animation). Each ingredient on its own row. Animation of each row to start slightly after the previous one.

The animation will be saved as an Essential Graphics animation in my library for reuse in PP. The number of ingredients will vary of course. And, the gap between the rows could vary depending on the total amount of ingredients on each recipe and the font size chosen for each recipe.

That´s the background sort of. Anyone with an expression tip on foremost the y positioning?

Thanks!

This topic has been closed for replies.
Correct answer ericsten

Hey Jakob, yes that whole expression goes in the position of each text layer.

Please note that this is set up to have your layers arranged with your text layers grouped together top down, with your control layer "Null" just above. This gives them their order in the group and the null tells your first text layer that it is the first in the bullet list.

Make sure you add the sliders and name them as I had specified in my first post.

- Eric

3 replies

ericsten
Inspiring
May 18, 2017

Hey Jakob, based on your description you may want something like this.

Create a Null Object and name it "Control", place it right above your list of text layers.

Add two sliders, name one "Group Y" and the other "Spread"

A=thisLayer.transform.position;                                                               // This layer's base position //

try {B=thisComp.layer(index-1).position;} catch (err) {}                           // Try to assign layer above's position to B variable //

try {C=thisComp.layer(index-1).text.sourceText;} catch (err) {C=false}  // Check to see if layer above is a text layer //

GroupY=thisComp.layer("Control").effect("Group Y")("Slider");             // Get value of "Group Y" Slider //

Spread=thisComp.layer("Control").effect("Spread")("Slider");               // Get value of "Spread" Slider //

if (C!=false) [A[0], B[1]+Spread] else [A[0], GroupY]                               // If the layer above is a text layer, spread, if not reference group Y//

JakobSjobom14249257
Known Participant
May 20, 2017

Hi ericsten

Thanks a lot for this! I sure will look in to this! I'll update here with how it goes. I just have to attend to another project that sudddenly got assigned to me, first.

jakob

Dave_LaRonde
Inspiring
May 17, 2017

I agree with Mylenium. It would appear you've chosen a workflow based more on Adobe marketing propaganda than on knowledge of what will work best for you.

JakobSjobom14249257
Known Participant
May 17, 2017

Hi Dave

Same thought after my response to Mylenium?

Let me describe the thought out workflow.

- I would create ten rows of dummy ingredients as a template

- After creation of the template in AE I'd import it in my library as an essential graphic

- in PP I would use as many rows that I would need, let's say three, and leave the rest blank.

For recipe X:

- 3 ingredients. Very few, why the text size can be quite big. But the row gap would have to adjust according to size (or rather, the distance from the row/layer above)

- Leave the rest of the seven rows blank.

For recipe Y:

- 7 ingredients. A bit mire of them this time. The font size cant be as big as the last example but the gap would have to be good and coherent.

- leave the rest blank.

Again, maybe I'm overthinking this. Or? :-)

Kyle Hamrick
Community Expert
Community Expert
May 17, 2017

If you're looking for a way to evenly distribute the position of the layers based on how many there are... yes, it can be done with expressions, but if you're new to AE, it'll likely be more trouble than it's worth for you.

Does each line use the same animation to come onscreen? If so, it might make sense to just make your template for a single line of text, and then you can iterate that in PP for each ingredient. You'll have to manually adjust the Y position in PP for each line, but this will also give you flexibility. Thinking about timing, you'd likely need this kind of flexibility anyway, since some ingredients will take longer to say than others, etc.

Mylenium
Legend
May 17, 2017

Why expressions? That makes totally no sense. You would simply apply text animators or put the stuff in a pre-comp for easy editing or both or a million otehr techniques involving effects such as transform and Motion Tile. It might be worth rethinking your approach rather than on looking for solutions that likely won't work in Premiere, anyway. You can't even change the font, so pardon me, but it seems you haven't thought this through correctly.

Mylenium

JakobSjobom14249257
Known Participant
May 17, 2017

Hi and thanks for your response!

For the animation itself there's no need for expressions. But I would think that for the y positioning of each row, an expression would be appropriat, to control the gaps between rows to accommodate for various font sizes. And maybe to to control the start of each row animation.

And regarding font; i will use the same font every time.

Maybe be you're right of course, I'm a bit of a noob in AE. But to avoid to manually change text size and row gap for each layer - that's why I thought expressions was the way to go. Are you with me? :-)