Skip to main content
Participating Frequently
March 23, 2019
Question

Two expressions on a single property

  • March 23, 2019
  • 1 reply
  • 5035 views

Hey guys, I've a time delay expression and I need to add a loopOut in the same property of position.

framesToDelay=3*index;

delay=framesToTime(framesToDelay);

thisComp.layer("drop").transform.position.valueAtTime(time-delay);

and I want to also add

loopOut("continue")

both in the position property. Is it possible?

Thank you in advance.

This topic has been closed for replies.

1 reply

Community Expert
March 23, 2019

I would put the loopOut("continue") in the drop layer's animation.

On the other hand, I don't think you want the motion to continue, I think you want the offset to increase as time passes. Let us know if that's what you want. You would do that by multiplying the frames to delay by the time or by adding time to the delay.

Something like this:

framesToDelay=index * time * 3;

delay=framesToTime(framesToDelay);

p = thisComp.layer("drop").transform.position.valueAtTime(time-delay);

I'm not exactly sure what you are trying to do.

Participating Frequently
March 23, 2019

I have a water-drops falling and and I need this animation to be repeated for 20 seconds.

What I did till now: I made the drop and add the following expression:

framesToDelay=3*index;

delay=framesToTime(framesToDelay);

thisComp.layer("drop").transform.position.valueAtTime(time-delay);

and finally I duplicated 2 times in order to have 3 water-drops.

And now I want this to be repeated for 20 seconds.

Community Expert
March 23, 2019

I take it that the "drop" layer is falling down. If you want the drop layer to fall down then fall down again just type loopOut() on that layer and the drop will fall again and again. If you use loopOut("continue") the first drop will fall down then continue off the screen. "Cycle" is the default so you don't need to specify that. "pingpong" makes the animation go back and forward.

Your original expression will make the other layers follow the original layer. Each drop will follow the original path precisely. If you want the drops in a different place you have to add a value + at the start of the last line in your original expression. Here's a sample comp that took me less than 3 minutes to create: Dropbox - water drop.aep If your browser adds a TXT extension to the AEP file just delete it.