Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Delaying animation with expression controls instead of keyframes

Community Beginner ,
May 16, 2024 May 16, 2024

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

TOPICS
Error or problem , Expressions , Scripting
637
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 16, 2024 May 16, 2024

Posting a screen capture of your timeline would help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 17, 2024 May 17, 2024

there it is

Annotation 2024-05-17 090145.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2024 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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2024 May 17, 2024
LATEST

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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 16, 2024 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 17, 2024 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines