Skip to main content
Astrid Martirossian
Participant
December 11, 2018
Question

How to make looped animation take twice as long in parented layer?

  • December 11, 2018
  • 1 reply
  • 163 views

Hi all,

In my composition I have two circles on separate layers, one large and one small.

The small circle has scale keyframes applied to it, which is then looped.

I want the large circle to mimic the scale animation of the small circle, which requires the following expression:

     thisComp.layer("SmallCircle").transform.scale

However, what I really want, is for the large circle to take twice as long to do the scale animation.

Say the small circle loop takes 2 seconds; then the large circle should do exactly the same, but in 4 seconds.

Of course when it's just two layers, I could just move the keyframes manually, but eventually I want to apply this effect to multiple layers and doing it manually would be a pain.

How can I achieve this by using expressions?

Many thanks in advance!

This topic has been closed for replies.

1 reply

Mylenium
Legend
December 11, 2018

You would use valueAtTime(), which depending on the requirements and flexibility needed could be a lot of convoluted code, especially when you have many keyframes, the layers can't be trimmed to their in- and out-points or the circles need to butt up to each other to stay in contact. Therefore I'd recommend you simply pre-compose your scale animation and use time-stretching/ time-remapping as needed. In any case you will need some form of control, so in the end it could still be efficient to manually push keyframes around. Even an expression needs discrete criteria on which to base its temporal calculations and whether you trim layers, dial in time stretch values or move keyframes is secondary - it's going to take at least some time and effort.

Mylenium