Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions wiggle color between two keyframes

  • wiggle color between two keyframes

    Posted by Jacob Roth on March 7, 2018 at 6:10 pm

    Hi all,

    I’m trying to get a solid to wiggle between two color values and I’m using dan ebberts expression for frequency found on motionscript.com, not even knowing if this is the right approach. I’m getting a bad argument at line 16: argument 5 to wiggle must be scalar.

    A) is this even the right approach

    B) if not, how do I do it.

    freq = effect("Color Control")("Color");
    amp = 10;
    n = freq.numKeys;
    if (n > 0 && freq.key(1).time < time){
    accum = freq.key(1).value*(freq.key(1).time - inPoint);
    for (i = 2; i <= n; i++){
    if (freq.key(i).time > time) break;
    k1 = freq.key(i-1);
    k2 = freq.key(i);
    accum += (k1.value + k2.value)*(k2.time - k1.time)/2;
    }
    accum += (freq.value + freq.key(i-1).value)*(time - freq.key(i-1).time)/2;
    }else{
    accum = freq.value*(time - inPoint);
    }
    wiggle(1,amp,1,.5,accum)

    Jacob Roth replied 8 years, 4 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    March 7, 2018 at 6:34 pm

    A) I don’t think so.

    B) What are you trying to do exactly?

    Dan

  • Jacob Roth

    March 7, 2018 at 6:38 pm

    I have two different color values, and I’d like to start at one, wiggle between the two for x amount of frames, and then return smoothly to the original color.

  • Dan Ebberts

    March 7, 2018 at 7:06 pm

    If your two colors are keyframed, play around with this:

    color1 = key(1).value;
    color2 = key(2).value;
    rampTime = .25;
    w = rotation.wiggle(3,1) – rotation;
    c = linear(w,-1,1,color1,color2);
    linear(time,key(2).time-rampTime,key(2).time,c,key(1).value);

    Dan

  • Jacob Roth

    March 7, 2018 at 7:13 pm

    It’s close enough.

    Thanks for everything you do, Dan. You’ve saved my butt multiple times.

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