FORUMS: list search recent posts

get X Y of layer in comparison of composition

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Atul Rajput
get X Y of layer in comparison of composition
on Aug 3, 2018 at 5:35:32 am

I have a composition of size 1280*720
and a layer of 150*75
I want to get the starting point of this layer in the composition in %,
For example:-
If the layer starts from the very beginning of composition then the x y should be 0% 0%.
if the layer starts at 640 and 360 then the X and Y should be 50% 50%;

Please help me out.


Return to posts index

Kalleheikki Kannisto
Re: get X Y of layer in comparison of composition
on Aug 3, 2018 at 7:52:27 am

This is the layer's position in percentage values, output to a text layer's source text:

L = thisComp.layer("My Layer");
x_per = L.transform.position[0]/thisComp.width;
y_per = L.transform.position[1]/thisComp.height;
x_per + "%, " + y_per + "%"


Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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