• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Co ordinates System in After efffects

Community Beginner ,
Sep 18, 2024 Sep 18, 2024

Copy link to clipboard

Copied

I have two shape layers set to the center of the comp, i applied the fromcomp expression to the transform position of the shape group (not the native transform position), to reference the position of the other layer (The Native Transform Position).
I understand what world space and layer space is in After Effects and the expression seems to work fine, but when i move the layer the other layer with the expression goes in the other the direction.
Why does it move that way. 

TOPICS
Expressions

Views

284

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

Community Expert , Sep 18, 2024 Sep 18, 2024

See if this works:

L = thisComp.layer("Layer_1");
fromComp(L.toComp(L.content("Rectangle 1").transform.position))

Votes

Translate

Translate
Community Expert ,
Sep 18, 2024 Sep 18, 2024

Copy link to clipboard

Copied

See if this works:

L = thisComp.layer("Layer_1");
fromComp(L.toComp(L.content("Rectangle 1").transform.position))

Votes

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
Community Beginner ,
Sep 18, 2024 Sep 18, 2024

Copy link to clipboard

Copied

It worked, Thank you.
But can yo please explain why my previous expression didn't work.

Votes

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
Community Expert ,
Sep 18, 2024 Sep 18, 2024

Copy link to clipboard

Copied

I have to admit I don't completely understand the relationship between the layer's transforms and and the shape's transforms, but it looks like the shape's position represents where it is relative to the layer's anchor point, which would mean it's in the layer's coordinate system. So to be useful in an expression on another layer, you'd first have to convert it to comp coordinates and then convert that into the expression layer's layer coordinates, which is what my expression does. Yours uses fromComp() on the other layer's shape position value, which is not in comp coordinates, so I wouldn't expect that to work. It's hard to explain, expecially when you don't understand it fully yourself. 🙂

Votes

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
Community Beginner ,
Sep 18, 2024 Sep 18, 2024

Copy link to clipboard

Copied

LATEST

I know the shape's transform positon uses layer's space and the layer's position uses comp space, isn't there a way to just straight up convert the layer's position (world's space) to layer's space co-ordinates to use in the shape's transform position, which was what i tried to do it in my own expression which didn't work

Votes

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