Forum Replies Created

Page 114 of 1081
  • Dan Ebberts

    June 7, 2021 at 4:52 pm in reply to: Triggering an animation using a Text Layer Value

    Something like this maybe:

    txt = thisComp.layer("Text").text.sourceText;

    t = 0;

    if (txt == "On"){

    f = timeToFrames(time);

    t = time;

    while (f >= 0){

    if (txt.valueAtTime(framesToTime(f)) == "Off"){

    t = time - framesToTime(f);

    break;

    }

    f--;

    }

    }

    t

  • I think your expression first needs to determine if the list is scrolling up, and if so, how far has it moved? To calculate the how far part, I think you’ll need to use valueAtTime(), to move back in time, frame by frame, to find the frame where the scrolling up began, and harvest the list’s position at that frame. Use that and the list’s current position to calculate how much of the header should currently be exposed. Tricky, but possible.

  • Dan Ebberts

    June 3, 2021 at 1:38 pm in reply to: Extracting data from text layer (non-numeric)

    You wouldn’t need parseInt() if you’re just comparing text. This should work:

    txt = text.sourceText;

    txt == "JP_ja" ? 2 : 1

  • Assuming that the layer in question is time remapped, then a time remapping expression like this might mask single-frame brightness bursts:

    sampleLayer = thisLayer;

    cNow = sampleLayer.sampleImage([sampleLayer.width/2, sampleLayer.height/2], [sampleLayer.width/2, sampleLayer.height/2]);

    brightnessNow = Math.sqrt(0.299*cNow[0]*cNow[0] + 0.587*cNow[1]*cNow[1] + 0.114*cNow[2]*cNow[2]);

    cPrev = sampleLayer.sampleImage([sampleLayer.width/2, sampleLayer.height/2], [sampleLayer.width/2, sampleLayer.height/2],true,time-thisComp.frameDuration);

    brightnessPrev = Math.sqrt(0.299*cPrev[0]*cPrev[0] + 0.587*cPrev[1]*cPrev[1] + 0.114*cPrev[2]*cPrev[2]);

    if (brightnessNow - brightnessPrev > .2)

    time - thisComp.frameDuration

    else

    time

  • The scale expression might be like this (for linear keyframes):

    txt1 = comp("Control").layer("first keyframe").text.sourceText;

    txt2 = comp("Control").layer("second keyframe").text.sourceText;

    s1 = parseFloat(txt1);

    s2 = parseFloat(txt2)

    linear(time,key(1).time,key(2).time,[s1,s1],[s2,s2]);

    The linear wipe expression could be similar, but it might be more complicated, depending on what kind of ease the keyframes have.

  • Dan Ebberts

    May 25, 2021 at 11:41 pm in reply to: better than ease ?

    It occurred to me that you can simplify this somewhat just by eliminating all the separate x and y stuff, like this:

    function myEase(curT,t1,t2,val1,val2){

    if(curT <= t1)return val1;

    if(curT >= t2)return val2;

    dtEase = t2 - t1;

    dvEase = val2 - val1;

    tEase = (curT-t1)/dtEase;

    if(tEase < .5) return val1 + (dvEase/2)*Math.exp(10*(2*tEase-1));

    return val1 + dvEase*(1-Math.exp(10*(1-2*tEase))/2);

    }

    startmarker = thisComp.marker.key(1).time;

    endmarker = thisComp.marker.key(2).time;

    inposition = thisComp.layer("IN").transform.position;

    outposition = thisComp.layer("OUT").transform.position;

    myEase(time, startmarker, endmarker, inposition, outposition);

  • Dan Ebberts

    May 25, 2021 at 6:23 pm in reply to: better than ease ?

    I think InOutExpo would be like this:

    function myEase(curT,t1,t2,val1,val2){

    if(curT <= t1)return val1;

    if(curT >= t2)return val2;

    dtEase = t2 - t1;

    dvEase = val2 - val1;

    tEase = (curT-t1)/dtEase;

    if(tEase < .5) return val1 + (dvEase/2)*Math.exp(10*(2*tEase-1));

    return val1 + dvEase*(1-Math.exp(10*(1-2*tEase))/2);

    }

    startmarker = thisComp.marker.key(1).time;

    endmarker = thisComp.marker.key(2).time;

    xinposition = thisComp.layer("IN").transform.position[0];

    yinposition = thisComp.layer("IN").transform.position[1];

    xoutposition = thisComp.layer("OUT").transform.position[0];

    youtposition = thisComp.layer("OUT").transform.position[1];

    x = myEase(time, startmarker, endmarker, xinposition, xoutposition);

    y = myEase(time, startmarker, endmarker, yinposition, youtposition);

    [x,y]

  • Dan Ebberts

    May 25, 2021 at 6:03 pm in reply to: better than ease ?

    I can probably do better than that, but I need to know what kind of ease you want. Do you still have access to the ease and wizz expression? It usually tells you right at the top which of the Penner eases it’s using.

  • Dan Ebberts

    May 25, 2021 at 5:25 pm in reply to: better than ease ?

    You could add your own ease function to the expression, but you’d need to know which of the ease and wizz functions you’re trying to emulate.

  • Dan Ebberts

    May 21, 2021 at 3:07 am in reply to: Split() expression with If else

    Try adding .length to the split array, like this:

    if(c.split("-").length>1){c.split("-")[1]} else {c}; 
Page 114 of 1081

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