ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Smoothing Expression, applied gradually?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kyle Hamrick
Smoothing Expression, applied gradually?
on Aug 23, 2013 at 3:19:13 am

Hey all,

I have some text tracked onto a clip. My aim: The text starts out still, then slowly moves into position and is tracked into the clip.






To get the text to track onto the footage properly, I used the 3D camera tracker. This footage is pretty shaky [somewhat intentionally, it helps make a point about the subject matter], and everything else, including Mocha, just wasn't getting it done.

My thought was that I could use this track to have the text sitting in the proper places when the footage is up, but to use an expression (smooth, I assume) to keep the text stationary until the clip begins fading in, and assume the shakiness of the footage gradually, so it's not a jarring transition.

I consider myself fairly expression-savvy, but this one has me puzzled.
I pickwhipped the camera values to a Null, to give me more control. The text is the only visible 3d element, so I can mess with the camera's values without affecting anything else in the scene.
I've tried using Smooth, with the values pickwhipped to expression sliders so I could have them gradually go from VERY smooth (no motion, effectively) to the full-on shakiness.


I've admittedly not used Smooth a lot before, beyond it's basic function. Clearly, my approach is all wrong, though. It's presenting me with a couple problems:

A. I can't get it to smooth nearly as much as I'd like; it's still quite shaky, even at the maximum settings.
B. On the other end of the spectrum, it doesn't appear that you can fully disable smooth. If you try to push the parameters to zero, it yells at you, so you can't actually get all the way back to your original values.
C. If I smooth the camera's rotation by more than 1 or 2, it goes NUTS and the text essentially just wheels wildly in and out of frame.


Any suggestions? Am I just approaching this from the wrong direction? I have a feeling the "time" parameter might be the key to this, but I'm not really sure what to do there.
I found this: http://forums.creativecow.net/thread/227/15761#15761, but I wasn't able to successfully transplant anything from there without my expressions blowing up even worse. Also, it made my brain explode.

Thanks in advance!

Kyle Hamrick

Editor/Motion Graphics Artist

http://www.kylehamrick.com


Return to posts index

Filip Vandueren
Re: Smoothing Expression, applied gradually?
on Aug 24, 2013 at 11:32:06 pm

- Don't animate "samples", just put it as high as you can while still being comfortable calculation times (100).
- Width doesn't have to be 0, at a value less than (0.5/framerate) the smooth should output values very very close to the original pre-expression values.

Orientation is problematic, because while we know that 359.9 and 0.1 degrees are very close to each other, smooth will try to average them out and get 180°.
I'm not that familiar with 3D tracking, but can you re-orient the origin of the scene so the values are actually hovering around 180° and never aproach 0°/359° ?
Or can you export the values to XYZ-rotation in stead of orientation ?


I find that having the settings at max like "smooth(1000,100);" will give me a practically non moving value, however it is at the average of all your values, not the start-value, Don't know if that affects you? Since the text seems to be coming forward, this setting will place it already halfway there.

Coming down from 1000 to 0.04 (frameduration at 25fps) is quite a big stretch, and you'll only see something happen in the final frames, so I think that should be done logarithmically.

So I would tackle it like this:

fd=thisComp.frameDuration;

sl=effect("Slider Control")("Slider").value/100; // animates from 100 to 0, we normalize to 1-0

exp=Math.pow(1000/fd,sl)*fd; // becomes exponential from 1000 to fd

sm=smooth(exp,100);

v0=valueAtTime(0);
linear(sl, sm, v0); // we slowly crossfade from the startposition of the value (v0) to the currently smoothed value while the smooth gets exponentially 'rougher'




Return to posts index

Kyle Hamrick
Re: Smoothing Expression, applied gradually?
on Aug 25, 2013 at 5:35:38 am

Thanks for the thoughts, Filip.

I'll give this stuff a shot in the morning. Really great thought on the Orientation, and the trouble it would have reconciling those as an average. I should be able to just transpose that over to the rotation properties instead, and that should fix that aspect.

I'll let you know how this works out. Thanks again!

Kyle Hamrick

Editor/Motion Graphics Artist

http://www.kylehamrick.com


Return to posts index


Kyle Hamrick
Re: Smoothing Expression, applied gradually?
on Aug 26, 2013 at 2:50:29 pm


Update: Transposing the Orientation into the individual Rotation values was definitely the key. Nothing a couple pickwhips and some basic code couldn't handle.
I'm still playing with getting exactly the effect I'm looking for, but I'm well on the way.

Thanks!

Kyle Hamrick

Editor/Motion Graphics Artist

http://www.kylehamrick.com


Return to posts index

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