Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions adding a delay to an expression controlled by a slider

  • adding a delay to an expression controlled by a slider

    Posted by Riccardo Sinti on August 30, 2011 at 7:33 pm

    I have a bunch of layers with this position expression linked to sliders for x, y and z.:

    a = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp X”)(“Slider”));
    b = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp Y”)(“Slider”));
    c = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp Z”)(“Slider”));
    [a[0],b[1],c[2]]

    I’m using it to wiggle the position of x,y,z.
    I’ve keyframed the sliders to zero for the wiggle’s amplitude and all the layers stop moving at the same time.
    Now I think I want to have the layers stop moving in succession.
    How can i add a simple delay so that the effect of the slider happens in succession?
    Thanks!

    Riccardo Sinti replied 14 years, 12 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 30, 2011 at 7:55 pm

    I don’t have time to test it, but something like this should give you a .1 second delay between layers:

    delay = .1;
    t = time – (index-1)*delay;
    a = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp X”)(“Slider”).valueAtTime(t));
    b = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp Y”)(“Slider”).valueAtTime(t));
    c = wiggle(3,thisComp.layer(“Sliders”).effect(“Amp Z”)(“Slider”).valueAtTime(t));
    [a[0],b[1],c[2]]

    Dan

  • Riccardo Sinti

    August 30, 2011 at 8:31 pm

    Thanks Dan, you are always a big help. That didn’t work, though. In fact, it kept the layer’s position wiggling. It seems to me that the delay needs to be added so that the layer looks at the sliders keyframes but delayed by X. I don’t even need to index the delay, I’ll just type in the number for the delay for each layer.
    I was looking at “valueAtTime(time – x)” to modify my original expression but I’m not sure where to put it or if that is even right.
    Thanks for helping me to (slowly) learn the expression language.

    Thank You

  • Dan Ebberts

    August 30, 2011 at 8:40 pm

    Sorry, it’s possible you grabbed the expression before I was able to edit it, because I left time out originally. Make sure you have the final version of the one that’s in my previous post and report back if it still doesn’t work.

    Dan

  • Riccardo Sinti

    August 30, 2011 at 8:50 pm

    That works great!
    Thanks.

    Thank You

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