Home Forums After Effects Expressions Explore the smooth() Expression

Viewing 0 reply threads
  • Author
    Posts
    • Nubby Ninja
      Keymaster
      Post count: 13

      Smoothing in keyframed animations is as easy as using the graph editor, but for expressions, this typically isn’t an option. Instead we’ll use the smooth() expression.

      I noticed some jerky movement with our wiggle() expression. Even after tuning with the sliders, the eye still seemed to dart every once in a while.

      So, all I did was add:
      smooth(.5,30) to the end of the Y-Wobble Amplitude slider expression, inside of the wobble() expression.

      Here it is:

      x=value;
      
      y=wiggle(thisComp.layer("Shape Layer 1").effect("Y-Wobble Frequency")("Slider"),thisComp.layer("Shape Layer 1").effect("Y-Wobble Amplitude")("Slider").smooth(.5,30));
      
      [y[0],x[1]]

      —————————-
      So smooth(a,b).
      “a” being the sample size, or how many frames to read for smoothing.
      “b” being the amount to smooth, e.g. 0%-100%
      ________________

      Then, just like with the wiggle() expression, I created slider controls for each of the smooth() expression’s parameters.

      Then within the wiggle() expression, I connected the smooth() expression’s parameters. (Shown below)

      x=value;
      
      y=wiggle(thisComp.layer("Shape Layer 1").effect("Y-Wobble Frequency")("Slider"),thisComp.layer("Shape Layer 1").effect("Y-Wobble Amplitude")("Slider").smooth(effect("Smoothing Sample")("Slider"),effect("Smoothing Amount")("Slider")));
      
      [y[0],x[1]]

      —————————-
      Now I have definite control over the wobble and smoothing expressions, without having to modify the expressions themselves for minor adjustments.

      • This topic was modified 2 years, 2 months ago by Nubby Ninja.
      Attachments:
      You must be logged in to view attached files.

      Nubby Ninja

Viewing 0 reply threads
  • You must be logged in to reply to this topic.