ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Combine expressions for position and anchor point with text animator

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christian Geijer
Combine expressions for position and anchor point with text animator
on Aug 10, 2018 at 7:51:22 am

Hi,

I have a paragraph text connected to a .json-file for its value.
Let's say I want the text to be centered in the composition, so I enter this position expression.
[thisComp.width/2, thisComp.height/2]

The source text from the .json-file can differ in length so to make sure that the text remains centered no matter what is inputted I use this expression on the anchor point.
boxTop = this.sourceRectAtTime().top;
boxHeight = this.sourceRectAtTime().height;
boxLeft = this.sourceRectAtTime().left;
boxWidth = this.sourceRectAtTime().width;
h = boxTop + boxHeight/2;
w = boxLeft + boxWidth/2;
[w, h];


This works just as intended. But if I want to add an animator for the position - let's say to animate each line one by one up 20 pixels - this doesn't work because I've locked the anchor point with the expression above. If I remove this expression the animator works just fine. But then I can't make sure that the text remains centered.

My questions regarding this are:
1) Is there a smarter/better way to make sure the text stays centered than using the combination of expressions above?
2) If not, is there a way to combine the animator for the text and still make sure the text stays centered in the composition?

Best regards,
/C


Return to posts index

Kalleheikki Kannisto
Re: Combine expressions for position and anchor point with text animator
on Aug 11, 2018 at 7:59:07 am

Pick a time before the text animation starts as the time value, as in sourceRectAtTime(*your static time value here*).

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Christian Geijer
Re: Combine expressions for position and anchor point with text animator
on Aug 13, 2018 at 6:50:45 am

Of course! Thank you so much for your help.
Have a great week!

/C


Return to posts index

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