Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Best Practices for Optimizing Expression Code for .Mogrts?

  • Best Practices for Optimizing Expression Code for .Mogrts?

    Posted by Will Batchelor on March 20, 2021 at 9:29 pm

    Hi new to this forum so apologies if this bible exists somewhere already.

    I am wondering what are some expression tips/tricks to speed up the processing and render times of a heavily coded .mogrt?

    I use posterizeTime(0) on all static values (Can you use inside a function so only part of the expression is calculated once? I haven’t had success with that). Recently I thought I was quite slick and converted all dynamically calculated values to individual sliders with a posterizeTime(0) on each, and then ran a series of linear expression triggered by markers to animate between. Sadly this backfired and slowed down the export instead of speeding it up.

    I also just learned to precompose the template and add hold keyframes where applicable to theoretically freeze any calculations that would be unnecessary. (I think it worked?) I am also in the process of learning how to use a .jsx footage file to house some global expressions but it’s a bit of a head scratcher for a wanna-be-coder.

    Any help would be appreciated! I just finished a cool (to me at least) template where I gave the editors the ability to highlight key words in a headline and then pull a new, smaller text box and shift it around. Just wish it didn’t take as long to export in premiere, and I’m sure there are more things I could do to speed it up. Sure does suck making something only to have it not be used because it’s too “slow” in premiere.

    I should add that most templates I make have the time protected region enabled for extending in premiere, so the graphics can become quite long and the calculations can add up quickly.

    Working on the most updated CC 2020 with the new Javascript Engine on a Windows. Added some photos of the linear expression code that was slow and the headline in its stages of animation.

    Thanks!

    Will

    Will Batchelor replied 5 years, 1 month ago 1 Member · 2 Replies
  • 2 Replies
  • Will Batchelor

    March 21, 2021 at 4:26 pm
  • Will Batchelor

    March 22, 2021 at 4:25 pm

    Quick update after a weekend of tweaking. Turns out I was overcomplicating quite a bit. I just precomposed the entire animation and added some hold keyframes anywhere that was applicable to freeze all calculations and it worked! Got my export times down significantly (from 30 minutes to 2 minutes). So now I can keep writing crappy code and just slap this band-aid on it and no one will ever know 🙂

    Cheers,

    Will

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy