Expressions and positions question.Help!


#1

Hi there. Im really a newbie regarding expressions in After Effects, so i know this might be a dumb question, but i really did a search and didn´t found the answer to my problem.

So, what i need is a layer,lets call it Layer 01, that moves according to the movement of another layer,Layer 02.Sounds easy enough. So i alt click the position property of Layer 01, i pick whip it with the position property of Layer 02, and cool, Layer 01 follows the movement of Layer 02 perfectly.

BUT, the thing is that Layer 01, although it follows the movement of Layer 02,its not in the position that i want it to be,i need it to be like… 50 pixels to the left and 80 pixels down (but following the exact same movements as Layer 02 still).

So,the expresion i got in Layers 01 position when i pick whip the properties was this:

thisComp.layer(“layer 02”).transform.position

I see that trying to change the position using the slider in Layer 01 obviously doesn´t work because the position is link to the Layer 02 position. So, with trial and error,i found it that if i add a -50 to that expression,so it looks like this:
thisComp.layer(“layer 02”).transform.position-50

,Layer 01 moves 50 pixels to the left (in the “x” axis),but still following the movement of Layer 02,exactly as i wanted. So… how the hell can i make Layer 01 move 80 pixels down in the “y” axis?

I´ve tried lots of expressions i saw on the web but nothing seems to work.

Again… i know this may be a stupid question, but im really new to expressions.

Any help would be greatly appreciated.


#2

Did you try to change the Origin’s position of layer 1 to the correct place?


#3

Thanks for your answer Eddepet.

When you say if i tried to change the origin´s position of Layer 01… what do you mean exactly? If i tried to change the anchor point position on Layer 01? Or the “normal” position? I´ve tried all that,but i dont get the result im looking for.

Actually, the situation its a bit more complicated that what i explained;i simplified the problem to avoid confusion,but well,here is the thing more detailed:

What i need to follow the exact same movements as Layer 02 its not Layer 01 position, is the source of an effect in Layer 01. So… i cant simply parent the Layer 01 to Layer 02,because it will move the whole Layer 01 and you would see the “limits” of the layer. I need Layer 01 to remain static,but the position of the source of a Flare effect i applied to it to follow the movements of Layer 02, which is a null object with motion track info in it.

As i said in the original post,when i alt click the watch in the “Flare Center” property of the effect in Layer 01,and link it with the pick whip to the position of Layer 02 (the null),the lens flare follows the movement of the null like it should,but its not in the position i need it to be… I hope that makes sense,its a little hard for me to explain the problem here.

I hope now its more clear what im trying to do.

Anyways… again, any help would be greatly appreciated.


#4

Yes, i meant the anchorpoint offcourse, sorry. I think you are right and can only be done by writing an expression.
I am also an newbie on AE and wanted you to point at Videocopilot.net, but saw you allready posted there. Andrew Cramer should know what to do. Maybe you can send him a personal message, cause there were still no replies i saw.
Succes!


#5

pRef=thisComp.layer(“Layer 1”).transform.position;

X=pRef[0]+50;
Y=pRef[1]+80;

[X,Y]

Mylenium


#6

Eddepet, thanks for your help men :slight_smile:

Mylenium, man, that work it out exactly as i wanted. I owe you mate, its not the first time you help me. I´m really grateful, thanks a lot for your help again. :slight_smile:


#7

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.