Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Please share your expression writing wisdom with a poor nature film maker

  • Please share your expression writing wisdom with a poor nature film maker

    Posted by Jacob Giacometti on July 21, 2016 at 4:35 am

    Hello guys,

    I’m really looking for your insights on how to accomplish this movement in after effects. It’s pretty simple but probably requires the right expression.
    I am animating an insect walking, shot from above. It has to look very realistic.
    I already shot the insect in macro on a blue screen, and have its walk looping perfectly in a 1 second comp.
    Now I need it to follow a bezier path, so it looks like it’s walking on the ground that will be layered beneath it.

    The thing is, the way insects walk is not a constant position change. This would look like the insect is sometimes floating (like in cheap cartoons). Instead, it will move 20 pixels forward along with its right legs, then stop moving forward for a few frames (the time it takes for its left legs to reach in front of him), then move again 20 pixels forward along with its left legs, then pause again, etc… It’s like move position 20 pixels over 5 frames, stop 5 frames, move position 20 pixels again, stop 5 frames, over and over.

    I am trying to find a good work flow, to have this start/stop motion looped (without having to draw the whole thing manually), as the insect comp follows the bezier curve I drew.

    Please share your insights on how to achieve this.

    As we say here in the Philippines, salamat po (respectfully thank you!).

    Kalleheikki Kannisto replied 9 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    July 22, 2016 at 8:40 am

    I’d do the following:

    For position, use a sine value to modify the time from which the position is retrieved:
    slowamount = 6;
    offsetamount=12;
    transform.position.valueAtTime(time+offsetamount/25+(Math.sin(2*time*Math.PI)/slowamount))

    “slowamount” here controls how much the sine curve affects the position. You need to adjust it to make it look good in your composition. Higher values mean less effect.

    “offsetamount” controls the number of frames the effect is offset. You can use this to make the motion match your animation.

    ValueAtTime, however, messes up the auto-orientation of the layer, so disable auto-orientation and use this code for the rotation instead:

    d = transform.position.valueAtTime(time+1/100)-transform.position;
    angle = radiansToDegrees(Math.atan2(d[1],d[0]))

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy