FORUMS: list search recent posts

Expression question: Lock position of layer to text length

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Taso Mastorakis
Expression question: Lock position of layer to text length
on Jan 18, 2018 at 11:09:37 pm
Last Edited By Taso Mastorakis on Jan 19, 2018 at 4:12:05 pm

Hey everyone, I'm sort of a novice with expressions and I found this one from Dan that almost does what I need it to:

gap = 10;
L = thisComp.layer("text");
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left+rect.width,0])[0];
[x+gap+width/2,value[1]]

It works great if the text layer is left justified moving to the right. Just wondering how I can reverse this to be right justified and have the secondary layer move to the left. I've tried switching a number of the attributes but nothing seems to work. Thanks in advance.


Return to posts index

Cassius Marques
Re: Expression question: Lock position of layer to text length
on Jan 19, 2018 at 7:41:18 pm

since he seems to be measuring the left boundary of the rectangle (created by the drawing of the text) and adding to it its width. (x = L.toComp([rect.left+rect.width,0])[0];) thus getting a position in relation to the comp thats allways to the right of the text box.

You may have to just remove the rect.width. You'll end up with the position of the left boundary, and thats it.

Try

gap = 10;
L = thisComp.layer("text");
rect = L.sourceRectAtTime(time,false);
x = L.toComp([rect.left,0])[0];
[x-gap-width/2,value[1]]


I'm rendering now and can't test it.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Taso Mastorakis
Re: Expression question: Lock position of layer to text length
on Jan 19, 2018 at 8:26:48 pm

That worked perfectly. Thank you so much. I've been racking my brain all day.


Return to posts index


Gates Bradley
Re: Expression question: Lock position of layer to text length
on Jan 19, 2018 at 11:07:46 pm

Haha, hey Taso what's up. Looks like we're both on here working out problems. Wish I could help you with your expression. I could use the same.

Ok carry on.


Return to posts index

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