ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

start position keyframe based on text layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Firuz Daud
start position keyframe based on text layer
on Oct 5, 2019 at 8:40:03 am

Hi everyone,
I'm not great at expressions. I have some idea about how I would do what I want to do, but I can't figure out how to connect it all together.

I have a shape layer and a text layer. I want the shape layer to come in first from the side and then the text layer comes in. The problem is the start position is different based on how long the text layer is. The longer the text is, the further the start position needs to be so it starts just off screen.

I know that sourceRectAtTime() can tell me about my text layer. I think I want my start position to be the negative of how long my text layer is. I think that will make my text and shape layer start off screen. I bet this is probably simple, but I can't figure it out. Am I on the right path or am I completely off base? Thanks so much! This is a great community!


Return to posts index

Firuz Daud
Re: start position keyframe based on text layer
on Oct 5, 2019 at 9:01:36 pm

I have it kind of working, but I'm pretty sure it's messed up and I had to mess around with number values and I'm not sure why. I've pasted the expressions I have in the box below. In order to get this result I messed around with some tutorial expressions, but I don't understand what's happening in the transform position.

On the text layer
s=thisComp.layer("TEXT_LINE_3");
w=s.sourceRectAtTime().width;
h=s.sourceRectAtTime().height/2;
l=s.sourceRectAtTime().left;
t=s.sourceRectAtTime().top;

ease (time, inPoint + 0, inPoint + 1.8,[l-(w+50),669], [l,669]);

On the shape layer size
s=thisComp.layer("TEXT_LINE_3");
w=s.sourceRectAtTime().width;
h=s.sourceRectAtTime().height;

[w,h]

on the shape layer position
s=thisComp.layer("TEXT_LINE_3");
w=s.sourceRectAtTime().width/2;
h=s.sourceRectAtTime().height/2;
l=s.sourceRectAtTime().left;
t=s.sourceRectAtTime().top;

[w+l,h+t]

on the shape layer transform position
s=thisComp.layer("TEXT_LINE_3");
w=s.sourceRectAtTime().width;
h=s.sourceRectAtTime().height/2;
l=s.sourceRectAtTime().left;
t=s.sourceRectAtTime().top;

ease (time, inPoint + 0, inPoint + 1,[l-(w+50),669], [l,669]);


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]