Forum Replies Created

Page 3 of 6
  • Julian Chojnacki

    October 4, 2023 at 3:56 pm in reply to: Source Text Expression – Caching Slow

    Hi Gary,

    try using posterizeTime(0); on top of your code to ensure it only gets calculated once rather than for every frame.

    Another way to help speed up playback would be converting your footage into ProRes as AE struggles with .mp4 files

  • Julian Chojnacki

    October 4, 2023 at 3:42 pm in reply to: Change slider value ratio to percentage

    Sure, here’s a breakdown:

    1. The first line takes your text value and splits it into an array of words based on the empty space ” ” between them.
    2. The second line converts the slider value from a 0 – 100 range into the word index based on the length of our word array. Since arrays are 0-based, we subtract 1 from it so we start counting from the first word. We then round the result down to the nearest integer using Math.floor, so we only deal with whole numbers.
    3. Finally, we use the calculated word index from “const i” to determine which word of our word array “const t” should be outputted.

    In your original code, you had some fallbacks to ensure your slider would only output a range from 0 – wordCount-1. If you plan to use your slider strictly from 0 – 100, we don’t need to modify them and can simply get rid of them.

    Last thing I did was to declare the variables with “const”. It’s not necessary in AE, but a common practice in JavaScript 🙂

  • Julian Chojnacki

    October 4, 2023 at 3:28 am in reply to: Change slider value ratio to percentage

    Hi Ludovic,

    you can do it like this:

    const t = value.split(" ");

    const i = Math.floor(effect("Word")("Slider").value * (t.length - 1) / 100);

    t[i];

  • Update: just found out that enabling motion blur or using the posterize time effect with a framerate other than the comps’ (could be 30.1 in a 30fps comp), fully eradicates glitched frames!

    Of course, there’s a little performance drop – a bit more for posterizeTime than MB which surprised me, but a working fix regardless. Case solved!

  • Bummer, but hey it works! Thanks anyway Filip 🙂

  • Update: I just noticed that scrubbing through the timeline a bit before previewing prevents any glitches from happening! How’d I miss this… but there are still some bugged-out frames when using text animators.

  • Julian Chojnacki

    June 30, 2023 at 11:37 am in reply to: Auto-scale text lines to same width on 1 layer

    Thanks for the suggestion, Filip!

    I tested the text layer method and it didn’t change much initially.

    Only when I ditched the line isolating range selector for an expression selector, it stabilized a bit. (wonder why)

    I noticed that now, glitching seems to mostly occur when hitting play at 0.

    Switching from full res to half res and vice versa, or updating the layer in another way seems to fix it.

    That said, when it catches some breath, playback is consistent now 👍

    Also, all lines are scaling as they should.

    Here are the updated expressions:

    Source text

    const widths = value.split("\r").map((_, i) => sourceRectAtTime(-1-i).width);

    if (time == -2){

    widths

    }else{

    value

    }

    Line Measurement:

    const t = -time;

    t == textIndex || time >= 0 ? 0 : 100;

    Expression selector

    const lW = text.sourceText.valueAtTime(-2).split(",").map(Number);

    const mW = effect("LineSizer")("Custom Width") == 1 ? effect("LineSizer")("Max Width") : lW[0]|1; // Fallback to 1 to ensure numeric value

    const i = textIndex-1;

    const s = (mW/(lW[i]|1))*100;

    time < 0 ? 0 : (s-100)/19; // Ternary to fix custom width not scaling as it should if there's only one line

    As you can see, I went the single-layer route because my goal for this is to work as an animation preset. Having a separate layer made no difference.

    Do you have any more thoughts on how to eliminate the glitching? I’ve experimented quite a lot and at this point, I’m running out of options.

    I could live with having to update the layer, but if anything else comes to your mind I’m listening 🙂

  • Julian Chojnacki

    March 27, 2023 at 11:21 pm in reply to: Paragraph Alignment Detection

    Filip, your code works brilliantly! Thanks for sharing 🤙

    I tried to generalize my code for all cases and ended up comparing a single characters rect positions in negative time with the positions of positive time source text value… but your technique is so much more straight forward…

    Would you mind explaining your thought process behind it?

  • This indeed did the trick and makes total sense! Thanks Filip 🙂

  • Hey Nick, this is a known issue with the newest 23.2 update, which you can fix by activating the Source Code Pro family on Adobe fonts.

Page 3 of 6

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