FORUMS: list search recent posts

Morph position between two parents

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Navarro Parker
Morph position between two parents
on Nov 18, 2013 at 8:57:41 pm

I'm looking for a way to have layer A "parented" to Layer B for a certain amount of time, then blend its position to Layer C over the course of 10 frames so Layer C is now the new parent.


Return to posts index

Kevin Camp
Re: Morph position between two parents
on Nov 18, 2013 at 11:04:05 pm

something like this would work for position:

target1 = thisComp.layer("Null 1");
target2 = thisComp.layer("Null 2");
startT = 5; // value in seconds
morphDur = 10; // value in frames

endT = startT+(morphDur*thisComp.frameDuration);
if (time < startT) target1.position;
else if (time > endT) target2.position;
else linear(time,startT,endT,target1.position,target2.position);


change target variables to your 'parent' layers, set the start time value and morph duration as needed.

if you needed other properties, like rotation, etc, to be linked, then you'd need to modify the expression for each property needed.

to ease between parents change 'linear' to 'ease' in the last line

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Jason Jantzen
Re: Morph position between two parents
on Nov 20, 2013 at 6:54:22 pm

that's pretty cool, but I can't seem to figure out why the expression makes the child layer jump. It starts out in the same position as the parent, then when I set the expression, it jumps off to the lower right. When I move the parent around, the child appears to move exponentially as well. Any thoughts on what's going on there?

Jason Jantzen
vimeo.com/jasonj


Return to posts index


Kevin Camp
Re: Morph position between two parents
on Nov 20, 2013 at 8:41:29 pm

actually you wouldn't want to use true parenting, the expression will simply take the position value from one layer, and then switch to the position of a different layer, but interpolate between the two positions during the transition.

looking back, i should have stated that my reply. sorry for the confusion.

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

Jason Jantzen
Re: Morph position between two parents
on Nov 20, 2013 at 10:00:26 pm

oh cool, I see now. How do you ease between targets? I saw the linear expression towards the bottom and I changed that to ease, and it seems ease a bit, but is there a way to easy it more?

Jason Jantzen
vimeo.com/jasonj


Return to posts index

Kevin Camp
Re: Morph position between two parents
on Nov 22, 2013 at 7:48:42 pm

to get a different ease function, you'd need to define your own function...

i haven't tried anything like that, but you can check out this post from dan:

http://forums.creativecow.net/readpost/227/23434

he creates a cubic ease-in function, but it would take a little work to get it to run with my example...

Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW


Return to posts index

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