2 Replies Latest reply on Dec 18, 2010 12:22 PM by Daz1761

# A Simple Expression Needed For After Effects CS5

Hello,

I'm currently doing an assignment for university involving a twitter bird produced with Photoshop CS5.

I have made the bird, imported it into AE CS5 and put 6 puppet pins mainly in the wings

The current position of PUPPET PIN 3 out of 6 is X 344 and Y 285.

All's I want to do is a move position X 344 to X 399 and back again constantly so the birds wings are appearing to be flapping.  Key frames could be used but would be very time consuming as the twitter bird will be flying constantly throughout the 1 minute long video.

The only expression line it gives you is:

effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 3").position

But sadly i'm quite new to AE and only seen simple expressions like Wiggle(2,30) being performed.

Also, does anyone know any good books or websites to get into this sort of stuff?  I do have a little knowledge of JavaScript so I do know what Arrays and variables are.

Many thanks, hope i get some good advice as this will be a big worry out the way for my video.

Darryl

• ###### 1. Re: A Simple Expression Needed For After Effects CS5

Can't give exact expression, but I try to help you figure it out.

Math.Sin is what you want.

http://jjgifford.com/expressions/geometry/frequency.html

http://en.wikipedia.org/wiki/Trigonometric_functions

Sin goes from 1 to -1, so you'll need to adjust it to fit your 399 to 285     (399-285 = 114)..  So you want it to go 0 to 114, and then add 285 to result.

Hope that gets you looking in the right direction.

-Dave

• ###### 2. Re: A Simple Expression Needed For After Effects CS5

Hi David

Thanks for the links, its definitely a point in the right direction!

Iv'e managed to do this and get the wings flapping!

frequency=3;

amplitude=60;

x=Math.sin(time*frequency)*amplitude;

rest=position;