Skip to main content
Inspiring
September 18, 2018
Question

Turbulent Displace Slider Controls Question

  • September 18, 2018
  • 2 replies
  • 698 views

Hi guys,

I am new to expressions, but I have an adjustment layer on top of a text layer.

On the adjustment layer I have a Turbulent Displace effect with the following expression applied to the Evolution property: time * 150.

I like how that animates. The problem is that at 3 seconds I would need to stop the expression and animate whatever value it's at at this point in time to evolution 0.

My Question now is as follows:

I tried applying a slider by highlighting the value "150" and then pickwicking to the slider control, which changed the expression to:

time *effect("Slider Control")("Slider")

however I am sure it's more comlicated than that since the slider value when set to '0' is not returning the evolution value to 0.

Any helps on this is much appreciated!

Thanks!

This topic has been closed for replies.

2 replies

Community Expert
September 18, 2018

I don't have time to write a fully automated expression for you but this will get the job done quickly. You define the time of the first keyframe as something like:

k1 = key(1).time

Then you add an if statement that says

if (time<k1)

    time*150

else value

That will run the expression until the time gets to the first keyframe. Move the CTI to one frame before the keyframe and remember the value. Now move to the first keyframe and set it to the same value. Then go to the last keyframe and enter zero.

Your time * 150 expression will run until run until you get to the first keyframe then the keyframes will take over. A purist may fiddle around with more language that remembers the value just before the first keyframe and then automatically reduces that value to zero by the time it gets to the last keyframe but that is going to be a lot more difficult and I can't do it in my head.

Roei Tzoref
Legend
September 18, 2018

Try this:

if (time<3) time*150 else 0

Inspiring
September 18, 2018

Thanks Roei, this however would just stop the expression from running after 3s. Perhaps I should have made it clearer to say that the reason I attached the slider to the evolution was to be able to set a keyframe at 2s and one at 3s. And then tween whatever value there is at 2s to the one at 3s, which should be set to evolution '0'.

Community Expert
September 18, 2018

Try my expression:

k1 = key(1).time

if (time<k1)

    time*150

else value

Then set values for the last two keyframes. The first value is the value one frame before the first keyframe, the last keyframe is zero. You do not need to add a slider control. Just apply that expression to evolution and set two keyframes.