Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions x rotation delay

  • Posted by Robert Trione on November 25, 2008 at 11:17 pm
    strt = 0; //start time of template motion
    end = 4.0; //end time of template motion
    
    t = thisComp.layer("template");
    offset = (t.effect("offset")("Slider")/100)*(index -1);
    travel = linear(t.effect("travel")("Slider")/100,strt,end);
    
    u = t.toWorldVec([1,0,0],travel - offset);
    v = t.toWorldVec([0,1,0],travel - offset);
    w = t.toWorldVec([0,0,1],travel - offset);
    
    sinb = clamp(w[0],-1,1);
    b = Math.asin(sinb/thisComp.pixelAspect);
    cosb = Math.cos(b);
    if (Math.abs(cosb) > .0005){
      c = -Math.atan2(v[0],u[0]);
      a = -Math.atan2(w[1],w[2]);
    }else{
      a = Math.atan2(u[1],v[1]);
      c = 0;
    }
    [radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]

    I have worked with delay expressions several times. The past couple of times I have been wanting to add a delay to the x rotation. I have looked at Dan Ebberts’s website and I found an expression that works with delaying the z rotation. https://www.motionscript.com/mastering-expressions/follow-the-leader.html I have no idea if I should try to use the expression as a jumping point…if so I actually have no idea how to change it. I added Dan Ebberts’s expression, but you might want to visit the site in order to see how he was using it.

    Thank you so much for your help,

    Robby Trione
    http://www.brainfarmproduction.com

    Robert Trione replied 17 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 26, 2008 at 4:06 pm

    You’re probably looking for something more like this:

    delay = 5; //number of frames to delay

    d = delay*thisComp.frameDuration*(index – 1);
    thisComp.layer(1).transform.xRotation.valueAtTime(time – d)

    Dan

  • Robert Trione

    November 26, 2008 at 5:28 pm

    Thanks, Dan. I actually tried that expression first. Every time I used that expression I got an error message:

    After Effects warning: Class ‘Group’ has no property or method named ‘xRotation’ Expression disabled.

    After you suggested to use it again…I tried the expression without a null layer and it worked fine. I then added a null and it stopped working. Then I moved the null from the top layer to the last layer and turned the expression back on and it worked. I guess the whole null thing is what got me so discouraged.

    Thank you for your help,

    Robby Trione
    http://www.brainfarmproduction.com

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