ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Parent and Expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
vahab san
Parent and Expressions
on Jul 7, 2018 at 9:23:01 am

Hi all

I have a simple animation on a solid layer's position using "linear(time, 0, 3, [0,0], [500,500])". (I must have the Position nim and max amount accurate coordinates.)
When I parent this layer to a null, position changes (anchorPoint of the null will become the center of animation on solid [0,0], and it disregards the native position of the layer)

How could I use expressions in a way that parent works like its keyframed animation (Solid layer stays in its place)?

Thanks a lot

a = [0,0];
b = [500,500]

c = linear(time,0,3,a,b);


Return to posts index

Dan Ebberts
Re: Parent and Expressions
on Jul 7, 2018 at 1:40:12 pm

Try it this way:


a = [0,0];
b = [500,500];

if (hasParent){
a = parent.fromComp(a);
b = parent.fromComp(b);
}

c = linear(time,0,3,a,b);



Dan



Return to posts index

vahab san
Re: Parent and Expressions
on Jul 7, 2018 at 6:20:12 pm

Hi Dan

Thank you for respond.

It perfectly keeps the solid to its place when I'm parenting it, but then it neutralizes the parenting effect on the null. I mean the solid is not following the null anymore as its child.


Return to posts index


Dan Ebberts
Re: Parent and Expressions
on Jul 7, 2018 at 7:27:13 pm

Sorry, I guess I didn't understand what you're trying to do.

Dan



Return to posts index

vahab san
Re: Parent and Expressions
on Jul 7, 2018 at 8:34:20 pm

I'm sorry I couldn't make it understandable.
I've recorded a very short



, I hope that you have time to take a look at it:

Thank you so much for your time.


Return to posts index

Dan Ebberts
Re: Parent and Expressions
on Jul 7, 2018 at 8:43:00 pm

OK, I think I get it. Unfortunately, I don't think there's any way to have a live link with the null like that because the expression has no way of knowing that the null has moved in the UI. It's a different story if you're keyframing the null movement, because the expression can compare where the null is now to where it was at time zero.

Dan



Return to posts index


vahab san
Re: Parent and Expressions
on Jul 8, 2018 at 6:04:44 am

Yeas I know what you mean.

Thanks a lot, Dan


Return to posts index

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