Forum Replies Created

Page 10 of 65
  • Andrei Popa

    January 12, 2022 at 9:59 pm in reply to: Highest Keyframe Value

    Your quotes are wrong, probably formatted from the forum. Delete and re-write them.

  • Andrei Popa

    January 9, 2022 at 8:06 pm in reply to: valueAtTime() on a REGEX Text Layer

    I think that on the error line, you use .valueAtTime() on a string. I think you should use .valueAtTime() first, then apply the regex+split. So get the sourceText property first, apply .valueaAtTime, then apply your replace(or any function that you want to apply to the string)

  • Andrei Popa

    January 7, 2022 at 3:50 pm in reply to: Trigger the change of the text source

    One way would be to put the text layers in order (from top to bottom), then add this expression you the layer that needs to change its value. It will have the value of the first layer form the inPoint and then change to the second layer when encounter the first maker and so on.

    firstLayerIndex = 1;
    idx = marker.nearestKey(time).index;
    if(marker.key(idx).time > time) idx--;
    thisComp.layer(firstLayerIndex+idx).text.sourceText
  • Andrei Popa

    January 7, 2022 at 3:32 pm in reply to: Audio count

    You can use the following function for that.

    So after you assigned the value via .setValueAtTime(yourTime) function, you can use

    .setInterpolationTypeAtKey(nearestKey(yourTime), KeyframeInterpolationType.HOLD)

    to toggle hold keyframe for that specific key.

    I am not sure how you’re code looks, so I can’t really tell you where to put this.

  • Andrei Popa

    January 7, 2022 at 12:54 pm in reply to: Audio count

    I am glad you made it. If you want more advice for future scripts:

    I use Visual Studio Code to write my script and an extension made by renderTom that’s called Adobe Script Runner to run them(you can execute any piece of code, even if not yet saved). You also have an extension made by adobe to replace Extendscript Toolkit (named Extendscript Debugger), but I don’t use that. It conficts with ESTK and I like ESTK more than the extension :D. I only use Extendscript Toolkit for indepth debuggind when something is not working.

  • Andrei Popa

    January 6, 2022 at 8:33 am in reply to: Audio count

    I think the sampleImage() function is pretty demanding. And the fact that you recursively use it must be what makes the render so slow. Just think that for the last frame, your expression must calculate all the values before, for each frame.

    You could either use the AudioToKeyFrames() to see if that is faster or make a script that sets keyframes each time it finds a kick. Because scripts have memory, you do not have to use while and go back in time each frame.

    For the script, you could do it like this.

    Check when kick is one and add a keyframe. The script should look similar to this

    myComp = app.project.activeItem;
    myKickSlider = myComp.layer("Kick count").effect("Slider Control")("Slider");
    
    //delete previous keyframes
    for (i = myKickSlider.numKeys; i >= 1; i--) {
        myKickSlider.removeKey(i);
    }
    
    //add new ones
    for (var i = 1; i <= timeToFrames(myComp.duration); i++) {
        if (myKickSlider.valueAtTime(framesToTime(i)) == 1) {
            myKickSlider.setValueAtTime(framesToTime(i), 1);
        }
    }
    

    Then the OutputSlider should have an expression similar to this:

    kicks = thisComp.layer("Kick count").effect("Slider Control")("Slider");
    k = kicks.nearestKey(time);
    n = k.index;
    if (time < k.time) n--;
    addedRotation = inc * n;
    

    base + addedRotation;

    You should define base and inc prior to this part.

    Haven’t tested these, so they may need a little tweak.

  • Just deselect the layer after selecting the other one, like this:

    proj = app.project;
    thisComp = proj.activeItem;
    thisComp.layer(thisComp.selectedLayers[0].index-1).selected = true;
    thisComp.selectedLayers[0].selected = false;

  • Andrei Popa

    December 11, 2021 at 7:11 pm in reply to: Saving the result of a script as a global variable

    Are we talking about scripts or expressions?

    Scripts are different files, pieces of code that you have to run. You can use extendscript for developing them

    Expressions are the pieces of code that go inside the properties in AE (when you alt+click the stopwatch).

    If you run a script and assign a value to a variable in a global scope, that variable is available until you close AE.

    If we are talking about expressions, the best way I can think of that you can share a numeric value is adding the expression to a slider and access that slider in other parts of your project (with the pick-whip).

  • Andrei Popa

    December 9, 2021 at 1:05 pm in reply to: parseInt boolean value

    You could simply check if the word is “true” by changing the second line to

    GEN = style.setAutoLeading(aL == "true");

    If the word is anything else but “true”, auto leading is set to false.

  • Andrei Popa

    December 8, 2021 at 9:57 am in reply to: Mexican wave expression selector

    Thank you very much Dan. That is way more than I expected 😀

    Do you happen to know any good course/video/article on expression selectors for text animators? I understand that the result acts similar to the “Amount” part of the selector. But I feel like I don’t have a good grasp on them.

    Thanks,

    Andrei

Page 10 of 65

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