ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expressions with keyframes animation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eduard Buturuga-PascuExpressions with keyframes animation
by on Dec 9, 2016 at 5:51:30 pm

Hi there, I'm trying to animate as series of shape layers, to be driven by 3 keyframes on a controller (null layer), but I'm trying to make AE calculate the difference between one layer and another, is there a reason why it's just not working? Here's my expression:

AE doesn't provide any error message, but the result of my Y position remains constant, even if the keyframes indicated in the 'controller' layer indicate an animation. Hope it makes sense. Thanks in advance for your help.

a = content("Group 1").transform.position[0];
b = content("Group 1").transform.position[1];
c = thisComp.layer("controller").transform.position[1];
d = c - [c - b];

[a, d]


Return to posts index

Dan EbbertsRe: Expressions with keyframes animation
by on Dec 9, 2016 at 6:48:40 pm

I'm not sure what you're trying to do, but this:
d = c - [c - b];

is the same as this:

d = b;

which is probably not what you want.

Dan



Return to posts index

Eduard Buturuga-PascuRe: Expressions with keyframes animation
by on Jan 15, 2017 at 9:13:13 pm

Thanks for that Dan, yes, I think that was the problem.


Return to posts index


marina martinsRe: Expressions with keyframes animation
by on Jan 11, 2017 at 12:19:54 pm

I don't know exactly what you're trying to do, but here's an expression that helped me. You can put in the position of the shape layer you want to animate.

With this rig, you can animate your controller from 0 to 100. 0 being the position of shape 1 and 100 being the position of shape 2.

First, you must put each of you shapes in a different layer.

To get the x position of a shape, you must pickwhip to the shape position and then type [0] at the end and for the y position you must type [1].

For example, x position of layer "Shape 01" would be:

thisComp.layer("Shape 01").transform.position[0]

Hope it helps!

a = x position of reference shape 1;
b = x position of reference shape 2;
c = y position of reference shape 1;
d = y position of reference shape 2;

x= a + thisComp.layer("controller").effect("Slider Control")("Slider")*(b-a)/100;
y= c + thisComp.layer("controller").effect("Slider Control")("Slider")*(d-c)/100;

[x, y]


Return to posts index

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