ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Position changes on the scale of the layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mac Lad
Position changes on the scale of the layer
on Sep 1, 2018 at 7:40:44 am

Hi Awesome Peoples;
I am animating a graph which has a bar(rectangle) and point(circle) which is on the upper edge of the bar. The bar is scaling from 0 to 100 in the y-direction. I tried an expression in the position of the point but it does not follow the bar to its total length.
For a basic idea of my layer and position

x=thisComp.height;
sy=thisComp.layer("bar").transform.scale[1];
m=x-sy;
[transform.position[0],m];


Return to posts index

James Ronan
Re: Position changes on the scale of the layer
on Sep 1, 2018 at 5:22:06 pm

If your circle layer has it's anchor point centered you could try this expression on it's position property:


L = thisComp.layer("bar");
r = L.sourceRectAtTime(time,false)
L.toWorld([r.width/2,r.top]);


Return to posts index

Mac Lad
Re: Position changes on the scale of the layer
on Sep 5, 2018 at 10:22:15 am

Thank you so much!!! that really helps man...I am new to scripting and especially new to "toWorld" expression. Made a few tweaks on my side to work as I needed. Final expression is bellow

L = thisComp.layer("bar");
r = L.sourceRectAtTime(time,false);
s=L.toWorld([r.width/2,r.top]);
[value[0],s[1]];


Return to posts index

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