Skip to main content
Inspiring
May 15, 2019
Answered

getting true position of parented layer (Just the y pos though!)

  • May 15, 2019
  • 1 reply
  • 9154 views

i want to link with expression Y position of Layer A to Layer B ( B is Parenter to C).

i tried to rearrange expressions like:

L = thisComp.layer("End1");

L.toWorld(L.anchorPoint);

or

thisComp.layer("childNULL").toComp([0,0,0])

but i cannot make these expressions work just for the y value.

my knowledge of expressions is too limited please help!

This topic has been closed for replies.
Correct answer matteociaociao

L = thisComp.layer("Shape Layer 2");

fullPosition = thisComp.layer("Shape Layer 2").toComp(L.anchorPoint);

x = [0] + effect("Slider Control")("Slider");

y = fullPosition[1];

[x,y]

i did this and it works, i put a slider there to control x indipendently

thanks a lot mathias great suggestion.

coming from c4d with tags, xpresso, and python, i really dont uderstand why ae is not catching up with more intuitive systems....get into expressions is hard!!!

1 reply

Mathias Moehl
Community Expert
Community Expert
May 15, 2019

the position values are arrays. So you can simply append [1] to get the y portion of it like this:

var L = thisComp.layer("End1");

var fullPosition = thisComp.layer("childNULL").toComp(L.anchorPoint);

var YPosition = fullPosition[1];

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Inspiring
May 15, 2019

thx man

but i tried and i just get errors.

what do you mean by "End1"?

i have just 3 nulls Called A, B, C.