Skip to main content
Known Participant
May 16, 2024
Question

Delaying animation with expression controls instead of keyframes

  • May 16, 2024
  • 2 replies
  • 710 views

Hello,
To get a slight delay in my animation on each duplicated groups, i made this simple expression on a trim path :

i=(thisProperty.propertyGroup(2).propertyGroup(1).propertyIndex)-1;
value + valueAtTime(time+i/10)

 

But i just want only one set of keyframes to control every groups. 

if i replace the "value" by a slider control for example, the delay no longer works. I don't know why.

Any idea? Thanks

This topic has been closed for replies.

2 replies

Mylenium
Legend
May 16, 2024

Why would you replace the "value" with the slider? This makes no sense. You need to manipulate the time inside the valueAtTime() function. Of course you may need a ton of extra code with linear() functions if you need exact values instead of the oens the function gives you, but I think you simply misunderstand the basics.

 

Mylenium

Known Participant
May 17, 2024

Because i want to duplicate the animation on a great amount of sub groups and be able to edit theire animation interpolation with 2 keyframes instead of hundreds. the linear doesn't give me this flexibility of editing though.

Dan Ebberts
Community Expert
Community Expert
May 16, 2024

Posting a screen capture of your timeline would help.

Known Participant
May 17, 2024

there it is

Dan Ebberts
Community Expert
Community Expert
May 17, 2024

I think it will be something like this:

delay = .1;
n = thisProperty.propertyGroup(4).numProperties;
myIndex = thisProperty.propertyGroup(3).propertyIndex;
diff = n - myIndex;
myDelay = diff*delay;
s = effect("Slider Control")("Slider");
s.valueAtTime(time - myDelay)

If you wanted it to go top to bottom (instead of bottom to top), it would be like this:

delay = .1;
myIndex = thisProperty.propertyGroup(3).propertyIndex;
myDelay = (myIndex-1)*delay;
s = effect("Slider Control")("Slider");
s.valueAtTime(time - myDelay)