FORUMS: list search recent posts

Parenting Position Retaining Orig Position of Child

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
andrew halasz
Parenting Position Retaining Orig Position of Child
on Jun 8, 2012 at 3:58:02 pm

I've search for a reference to this specific question for quite a bit of time. I seems rudimentary, but I would love some closure.

I have to objects on a comp (layer "A" and layer "B")- I would like to use an expression to parent the position of the one to the other (A as parent, B as child). I've been unable to find an expression that does not change the original position of B when entering the expression.

It either places B directly at the same position as A with this expression

thisComp.layer("A").transform.position

or displaces B to a different position using this expression

L = thisComp.layer("A");
fromWorld(L.toWorld(L.thisComp.layer("A").position))

Both of course then allow B to then follow A's position, but I'm curious if there is a way to have B remain its orig position.

My work around has been to add +value to the expression and move B back to its orig position.

Any help would be greatly appreciated.


Return to posts index

Dan Ebberts
Re: Parenting Position Retaining Orig Position of Child
on Jun 8, 2012 at 7:21:12 pm

One way to do it is to add layer B's current position to the amount that Layer A has moved since time zero:

p = thisComp.layer("A").transform.position;
value + p - p.valueAtTime(0)


This won't do anything until you actually animate layer A's position though.

Dan



Return to posts index

andrew halasz
Re: Parenting Position Retaining Orig Position of Child
on Jun 9, 2012 at 4:06:51 am

Thanks Dan! Works Great!


Return to posts index

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