Skip to main content
ttemidayoo
Participant
September 18, 2024
Answered

Co ordinates System in After efffects

  • September 18, 2024
  • 1 reply
  • 673 views

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. 

This topic has been closed for replies.
Correct answer Dan Ebberts

See if this works:

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

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
September 18, 2024

See if this works:

L = thisComp.layer("Layer_1");
fromComp(L.toComp(L.content("Rectangle 1").transform.position))
ttemidayoo
Participant
September 18, 2024

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

Dan Ebberts
Community Expert
Community Expert
September 18, 2024

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. 🙂