ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Smooth expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eric Sanderson
Smooth expression
on Feb 3, 2011 at 8:27:52 pm

I applied some tracking info to a null and through a smooth() on the position to, smooth it out obviously. But later in my workflow ive needed to value+position pickwhip that null to another null upstream, i typed .smooth after my pickwhipped position line and got no error but also got no visible result. How can i still use my smooth function value while adding/pickwhipping to another layers position?


Return to posts index

Dan Ebberts
Re: Smooth expression
on Feb 4, 2011 at 5:41:58 am

smooth() is like wiggle in that its result includes the value of the property. To isolate the effect of smooth() you need to subtract value. Then you can add it to any other position -generating expression. So the isolation part looks like this:

s = smooth(.2,5)-value;

Then just add s to the position of the null.

Dan



Return to posts index

Jacek Skrobiasz
Re: Smooth expression
on Dec 5, 2015 at 3:22:08 pm

There is possible to apply smooth to evaluated value instead of original?

My case:
After 3D camera tracking I have many 0<>360 jumps in Camera's Orientation property.
So I apply expression to orientation:

([transform.orientation[0]-10, transform.orientation[1]-10, transform.orientation[2]-10]);

10 is a maximal degrees variation iny may Camera'a orientation, so now its values are between 350-360 degrees without jumps.
I want to apply additional smooth to orientation.
But after adding:

smooth(width = .2, samples = 5, t = time);

...Camera's orientation again jumps 0<>360, and my earlier expression is ignored.

There is a way to solve this?



Return to posts index


Dan Ebberts
Re: Smooth expression
on Dec 5, 2015 at 7:47:16 pm

smooth() only works on pre-expression property values. I think it's just a simple box filter though, so you should be able to do what you're trying to do by building your own smoother, like this:

(valueAtTime(time - .1) - [10,10,10] +
valueAtTime(time - .05) - [10,10,10] +
value - [10,10,10] +
valueAtTime(time + .05) - [10,10,10] +
valueAtTime(time + .1) - [10,10,10])/5;


Dan



Return to posts index

Jacek Skrobiasz
Re: Smooth expression
on Dec 5, 2015 at 9:12:55 pm

It is better solution than my current [dirty] workaround by Converting Expression to Keyframes and apply smooth() afterwards.

Thanks!


Return to posts index

Marian-Mina Mihai
Re: Smooth expression
on Sep 11, 2019 at 10:27:30 pm

Hi. I know I'm 5 years late to the party, but maybe someone still has this issue. My solution was to:
1. offset the value so that it stays in the 0-360 range
2. convert expression to keyframes
3. apply the smooth() expression
4. convert expression to keyframes
5. offset the value back so you get the original range, but with the smooth expression applied ()
Hope it helps!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]