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

Participant ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

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!

TOPICS
Expressions

Views

3.6K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , May 15, 2019 May 15, 2019
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 indipendentlythanks 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!!!

Likes

Translate

Translate
Adobe Community Professional ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

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];

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 15, 2019 May 15, 2019

Copy link to clipboard

Copied

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!!!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

LATEST

Why don't you use the L that you defined?

 

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

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

 

Is the 2nd line the same as

 

fullPosition = L.toComp(L.anchorPoint);

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines