-
1. Re: The value of this expression
Mylenium Apr 3, 2013 1:28 AM (in response to Cris is Bliss)Multiply it with the scale:
fScaleX=thisLayer.transform.scale[0];
fScaleY=thisLayer.transform.scale[1];
fWidth=thisLayer.width;
fHeight=thisLayer.height;
X=fWidth/2*fScaleX/100;
Y=fHeight/2*fScaleY/100;
[X,Y]
Mylenium
-
2. Re: The value of this expression
Dan Ebberts Apr 3, 2013 3:47 PM (in response to Cris is Bliss)I think you might need to do a layer space transform to get the center of the other layer into comp coordinates and then get that point into the coridnates of the layer with the expression. Like this:
L = thisComp.layer("flower");
fromComp(L.toComp([L.width/2, L.height/2]))
Dan
-
3. Re: The value of this expression
Cris is Bliss Apr 4, 2013 10:15 AM (in response to Mylenium)Thank you,
I don't want to sound stupid, and I do want to learn more about using expression but I have no idea of how to use this--- do I place it before, after or in place of the [thisLayer.width/2, thisLayer.height/2] expression. NO don't tell me. This weekend when I have some extra time I will play around with it and try to figure it out myself. If I don't get it to work I will let you know.
Just looking at it I think it relates to the Scale property of the Layer that it is played in. and it replaces the x,y values of the scale property with the width of the layer divided by 2 times the Scale divided by 100. I just don't see what that "f" stands for.
Thanks
-
4. Re: The value of this expression
Cris is Bliss Apr 4, 2013 10:33 AM (in response to Dan Ebberts)Thank you for the feedback Dan,
Again as I said above, I don't want to sound stupid but.....
Just looking at it, I kind of understand what your expression is saying. What I don't fully follow is your explanation. I think you are saying--Do a layer space transform to get the center of the other layer's coordinates to read as if written in the Composition coordinates BECAUSE a layers coordinate is based upon the upper left corner of the layer where as the Comp's coordinates are based upon the upper left corner of the Comp and they are only the same when a layer is the exact same size as the Composition and placed in the center of Compsition.
-
5. Re: The value of this expression
Dan Ebberts Apr 4, 2013 10:39 AM (in response to Cris is Bliss)That sounds right, but then you also need to convert from comp coordinates to coordinates for the layer with the expression. That's what fromComp() does. Of course, none of this is necessary if all layers are comp-sized, centered in the comp, not scaled or rotated, etc.
Dan



