Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Gradually increase Wiggle over time by pixel — Not by layer

  • Gradually increase Wiggle over time by pixel — Not by layer

    Posted by Jason Gold on December 13, 2023 at 10:23 pm

    I’ve been trying to ramp up the wiggle effect on a per-pixel basis, not the entire layer. I’ll give two examples. 1. If you can imagine a rope that you whipped. Near your hand let’s say that the wiggle is non-existent. (0,0) and at the very end of the 15ft rope there is a lot of movement. 2. Another example would could be a spray nozzle on a garden hose. Near the gun/nozzle the particles spray out straight. As the particles get further away, wind and colliding forces of the droplets cause turbulence. In either case the turbulence increases gradually. (Particles that have just been born don’t wiggle. Particles that are near death wiggle a lot.) The closest script I’ve come across is from Dan Ebbert’s here at the Cow, but from what I can tell it’s gradually ramping the wiggle of the entire layer.

    fStart = 100;

    fStop = 200;

    fRamp = 5;

    amp = 5;

    freq = 5;

    tStart = framesToTime(fStart);

    tStop = framesToTime(fStop);

    tRamp = framesToTime(fRamp);

    if (time < (tStart + tStop)/2)

    a = linear(time,tStart,tStart+tRamp,0,amp)

    else

    a = linear(time,tStop-tRamp,tStop,amp,0);

    wiggle(freq,a)

    Dan Ebberts replied 2 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    December 14, 2023 at 12:36 am

    I’m trying to picture what it is that you’re actually trying to wiggle. Are you planning on applying the expression to a bunch of “particle” layers, where the amount of wiggle (in the y direction?) depends on time and the layer’s x position, or is it something else entirely?

  • Jason Gold

    December 14, 2023 at 4:42 am

    One layer.

    I can think of a few examples once I know the correct syntax, but for now let me stick with particles. An emitter is spraying out a narrow stream of particles from one side of the screen to the other. If I apply wiggle(5,50) to the position property, every particle will wiggle randomly. I would prefer that each particle gradually become turbulent due to the wiggle.

    I’ve tried using a slider with keyframes at the beginning and end of the comp, but this gradually increases the wiggle of every particle on the screen. If I could somehow link the age of young particles to be 0% affected by the wiggle, and old particles to be 100% affected by the wiggle it would appear that the turbulence gradually increases.

    I also thought of trying to use the color-at-birth and color-at-death parameters to control the percentage of wiggle so that it gradually increases. White particles = 0% wiggle; and Black particles = 100% wiggle. In this case I can imagine that a Luminosity value of a particle could control a percentage of wiggle(5,50) — such as: a gray particle (being 50% luma) might result in wiggle(5,25). In plain language, [If hex code of particle = #ffffff, then wiggle(5,0)] and [If hex code of particle = #000000, then wiggle(5,50)].

    Another way to describe what want is by looking at the Opacity Map for particles. We can draw ramp/curve to fade the particles in/out. If “Wiggle” had this map I could tell AE that new particles don’t wiggle and old particles wiggle a lot…..but,, maybe in a later update. 🙂

  • Dan Ebberts

    December 14, 2023 at 7:34 am

    Starting simple, this will ramp up the amplitude of the wiggle over the duration defined by tRamp:

    freq = 5;
    amp = 200;
    tStart = 0;
    tRamp = 5;
    a = linear(time,tStart,tStart+tRamp,0,amp);
    wiggle(freq,a)

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