ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Position Coordiates from Child

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Zygadlo
Position Coordiates from Child
on Jun 4, 2020 at 12:50:16 pm

Hey everyone,

I am working on a personal project where I have built a solar system of planets spinning around the sun. I will simplify my idea to give you a clear understanding of what I am trying to do.

We have three planetary bodies in 3D space (Sun, Planet and Moon), where the moon orbits around the planet and they are orbiting around the sun. I am using nulls for each planetary body in order to control them, etc. The parent link order as follow... Moon connected to the planet and the planet is linked to the sun; where sun rotates and moves the planet, etc.

Next, I add an overlay graphic which points and highlights the planet location; sadly, the graphic doesn't move with the planet movement. The position of the planet doesn't update in the world space, hence the overlay graphic isn't moving.



My question is how do I gain the position coordinate from the child layer when attached to the parent layer?

Thank you,
Addz

Adam Jozef Zygadlo
Motion Graphic Designer

07708 124 915
http://www.jarbrain.com
'Filled with brainy goodness.'


Return to posts index

Dan Ebberts
Re: Position Coordiates from Child
on Jun 4, 2020 at 1:54:53 pm

Like this:

L = thisComp.layer("Null 3");
L.toComp(L.anchorPoint)


Dan



Return to posts index

Adam Zygadlo
Re: Position Coordiates from Child
on Jun 4, 2020 at 3:13:00 pm

Hey Dan,
Hope you are well and keeping yourself safe.

I tried that code after looking at other posts on the forum but it was not working but after tweaking and reading the line of code again, it seemed to work now.

In fact, I believe it wasn't working as I was using the light layers instead of nulls. Good to know this fact.

Thank you again for your support,

Take care,
Addz

Adam Jozef Zygadlo
Motion Graphic Designer

07708 124 915
http://www.jarbrain.com
'Filled with brainy goodness.'


Return to posts index


Dan Ebberts
Re: Position Coordiates from Child
on Jun 4, 2020 at 3:20:58 pm

Yes, for lights (or cameras) you'd want to do it like this:

L = thisComp.layer("Light 1");
L.toComp([0,0,0])


Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]