Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions marker trigger 3d rotation

  • marker trigger 3d rotation

    Posted by Guillaume Charron on August 25, 2009 at 2:58 pm

    Hi,
    I was using this expression to animate in a text layer on the X rotation (3D):

    veloc = 7;
    amplitude = 80;
    decay = .7;

    amplitude*Math.sin(veloc*time)/Math.exp(decay*time)

    To make it start when I wanted, I had to precomp it (because it uses the time of the comp). So I found another expression to trigger the expression with a marker:

    if (marker.numKeys > 0 && time >= marker.key(1).time){
    t = time – marker.key(1).time;
    freq = 2.0; //oscillations per second
    amplitude = 90;
    decay = 1.5;

    rotCos = Math.abs(Math.cos(freq*t*2*Math.PI));
    x = amplitude*rotCos/Math.exp(decay*t);
    value – [x]
    }else{
    value
    }

    It works but it is not swinging in both directions. It bounced on the 0 value and swing back up.

    Can you help me make it swing correctly using a marker as a trigger?

    thanks.

    Guillaume Charron replied 16 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 25, 2009 at 6:35 pm

    Try this:

    if (marker.numKeys > 0 && time >= marker.key(1).time){
    veloc = 7;
    amplitude = 80;
    decay = .7;
    t = time – marker.key(1).time;
    amplitude*Math.sin(veloc*t)/Math.exp(decay*t)
    }else{
    value
    }

    Dan

  • Guillaume Charron

    August 25, 2009 at 8:34 pm

    I knew it was something like that. I tried to find it myself but it didn’t work. THANK YOU very much. 🙂

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