Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Offsetting pickwhipped values by X frames?

  • Offsetting pickwhipped values by X frames?

    Posted by Nicolas Hansen on May 27, 2009 at 2:25 pm

    Hello!
    Quick intro: I have 13 sunflowers, all precomped, with a CC Bend It filter applied to them. I then have a Slider control with 3 keyframes (that loops) going from -5 to 5 to -5. All of these CC Bend it “Bend” values are linked to the slider value.
    Now all 13 of my sunflowers slowly sway back and forth. But… in unison. Which makes it look quite unnatural. I’ve tried adding valueAtTime(time-x/30) where x is the number of sunflower from left-right, 30 being my fps (so basically it’d be offset x frames) – but that stopped my bending from happening.
    Also, keep in mind that this should loop, which it does as of now, and if I offset the time at which they bend, it should still loop.
    I’m probably making this sound more complicated than it is.
    I know I could probably just make 13 sliders and offset them manually, but where’s the fun in THAT?
    What would you suggest to offset each sunflowers bend, while maintaining it’s loop?
    Do you have other suggestions for making a line of flowers sway in the breeze better than CC Bend It and some keyframes? This just seemed like the simplest way.
    Am I wrong in trying to use valueAtTime()? I’m a semi novice to expressions so I don’t really know what to try. I have no problem with adding more sliders, 1 per flower, but that is just a waste… and if I want to change the wind, I’d have to change ALL the sliders, and that would just be a mess.
    So any help with my horizontal line of naturally swaying, looping flowers would be great! 🙂
    Thank you
    Nicolas

    Nicolas Hansen replied 16 years, 11 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    May 27, 2009 at 3:30 pm

    it sounds like it should work… you may be using valueAtTime() incorrectly. try something like this:

    L = thisComp.layer(“Null 1”).effect(“Slider Control”)(“Slider”); //use the pickwhip to target your bend it layer and slider.
    L.valueAtTime(time – index / 30)

    the ‘index’ value is the layer order in the timeline, if that doesn’t work for you, you can set that to any number that you want…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    May 27, 2009 at 3:42 pm

    Something like this maybe:

    delayPerFlower = .1;

    t1 = key(1).time;
    t3 = key(3).time;

    dur = t3-t1;

    delay = index*delayPerFlower;
    t = (time+delay)%dur;
    valueAtTime(t1+t)

    Dan

  • Nicolas Hansen

    May 27, 2009 at 4:16 pm

    Ah, I must have been using valueAtTime wrong. That worked, thanks!

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