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

adding source text keyframes via script takes forever!

Contributor ,
Dec 11, 2024 Dec 11, 2024

Copy link to clipboard

Copied

I have a script which pulls text from a text file and then assigns keyframes to the sourcetext of a Text layer. 

All the testing was done with 10 keyframes and it works a treat.

the script can open and read the text file and add the keyframes in less than a second.

 

but now I'm trying to add 100+ keys and After Effects just grinds to a halt. it takes minutes and Ae is sitting there chugging 110% of the CPU to do what seems to be a super trivial task.

 

can anybody shine a light in what is happening and how I might speed this process up?

TOPICS
Performance , Scripting

Views

82

Translate

Translate

Report

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 ,
Dec 11, 2024 Dec 11, 2024

Copy link to clipboard

Copied

You didn't mention how you're doing it now, but if you're using a loop with setValueAtTime(), you should try setValuesAtTimes() with arrays of times and values.

Votes

Translate

Translate

Report

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
Contributor ,
Dec 18, 2024 Dec 18, 2024

Copy link to clipboard

Copied

Dan, thank you as always. You're assumption was indeed correct, I had never even clocked there was such a method for batch setting keyframes! Applying as arrays certainly sped things up. But I have to say it still seems incredibly slow. Applying thousands of keyframes to other properties such as position or opacity is orders of magnitude faster. I get the feeling that there's a lot more going on behind the scenes with text layers... anyway thanks again for the advice 

Votes

Translate

Translate

Report

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 ,
Dec 12, 2024 Dec 12, 2024

Copy link to clipboard

Copied

It looks like After Effects is struggling with performance when adding a large number of keyframes. One thing that could help is breaking the keyframe creation into smaller batches. Also, try using property expressions instead of adding keyframes one by one if possible. If the issue continues, it might be worth checking if the script can be optimized or considering third-party solutions. Hope this helps!

Votes

Translate

Translate

Report

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
Contributor ,
Dec 18, 2024 Dec 18, 2024

Copy link to clipboard

Copied

LATEST

hey Balian_2014, thanks for the input. I did try an expression approach and it was actually surprisingly performant given the rather large size of the array that was being used as the source but it ended up being too cumbersome. Breaking up the keyframe creation into batches might also help. After a bit of testing i found that the performnce really dropped off at about the 100 keys mark. What was really wierd though was a couple of times when I was testing it seemed like AE would wig out with some kind of memory leak... reapplying the same 10 frames would get progressivley slower and slower... 

Votes

Translate

Translate

Report

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