Forum Replies Created

Page 129 of 1081
  • Dan Ebberts

    November 5, 2020 at 9:54 pm in reply to: time expression

    I think this is what you mean. Just adjust tStart to where you want playback to begin:

    aud = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    threshold = 5;

    tStart = 1;

    val = tStart;

    if (aud.value > threshold){

    t = time - thisComp.frameDuration;

    while (t > 0){

    if (aud.valueAtTime(t) < threshold) break;

    t -= thisComp.frameDuration;

    }

    val += time - t;

    }

    val

  • Dan Ebberts

    November 5, 2020 at 7:15 pm in reply to: Math.sin easing?

    Hard to guess what you’re after exactly, but maybe something like this:

    freq = 2;

    amp = 100;

    period = 1/freq;

    t = time%period;

    tt = ease(t,0,period,0,period);

    amp*Math.sin(freq*tt*Math.PI*2)

  • Dan Ebberts

    November 5, 2020 at 6:38 pm in reply to: time expression

    Something like this might work. Adjust the threshold value to what works best for you:

    aud = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    threshold = 5;

    val = 0;

    if (aud.value > threshold){

    t = time - thisComp.frameDuration;

    while (t > 0){

    if (aud.valueAtTime(t) < threshold) break;

    t -= thisComp.frameDuration;

    }

    val = time - t;

    }

    val

  • Dan Ebberts

    November 5, 2020 at 8:03 am in reply to: copy markers from layer markers to comp markers

    It’s easier to do now that scripting has access to comp markers. Something like this should work:

    var theComp = app.project.activeItem;

    var theLayers = theComp.selectedLayers;

    var theMarker = new MarkerValue("");

    for (var i = 0; i < theLayers.length; i++){

    theMarker.comment = theLayers[i].name;

    theComp.markerProperty.setValueAtTime(theLayers[i].inPoint,theMarker);

    }

  • Dan Ebberts

    November 2, 2020 at 4:52 pm in reply to: Upper and Lower Text and maybe bold ???

    Something like this should handle the upper/lower case part (but not the bold):

    txt = thisComp.layer("Alex Dinnin (GBR)").text.sourceText.value;

    splt = txt.split(" ");

    str = splt[0][0].toUpperCase() + splt[0].substr(1).toLowerCase();

    str += txt.substr(splt[0].length).toUpperCase()

  • Dan Ebberts

    November 2, 2020 at 4:26 pm in reply to: Checkbox Controlled Opacity

    >Made it work with this:…

    A single-line if/else like that will only work with the Legacy ExtendScript engine (or an old version of AE).

    >What if I want to go more advanced…

    Try this:

    cb = thisComp.layer("Adjustment Layer 4").effect("Checkbox Control")("Checkbox");

    if (numKeys > 3){

    if (cb.numKeys > 0){

    n = cb.nearestKey(time).index;

    if (time < cb.key(n).time) n--;

    if (n > 0){

    t = time - cb.key(n).time;

    if (cb.value){

    t1 = key(1).time;

    t2 = key(2).time;

    }else{

    t1 = key(3).time;

    t2 = key(4).time;

    }

    tt = linear(t,0,t2-t1,t1,t2);

    }else{

    tt = (cb.value) ? key(1).time : key(3).time;

    }

    }else{

    tt = (cb.value) ? key(1).time : key(3).time;

    }

    valueAtTime(tt);

    }else{

    cb.value ? value : 0;

    }

  • Dan Ebberts

    November 2, 2020 at 11:00 am in reply to: Checkbox Controlled Opacity

    Try it like this:

    thisComp.layer("Adjustment Layer 4").effect("Checkbox Control")("Checkbox")==1 ? value else 0
  • Dan Ebberts

    October 31, 2020 at 7:58 pm in reply to: Expressions: Move two text lines

    Has the left-most text layer been scaled?

  • Dan Ebberts

    October 28, 2020 at 6:44 am in reply to: Why this expression breaks with the new JavaScript?

    With a csv file you could have your expression get the data index from the comp name, which would be pretty simple if your comps were named like “Comp 1”, “Comp 2”, etc.

    Then, assuming your imported data file (named data.csv for this example) looks like this:

    Names

    Mike Jones

    Rob Smith

    Cindy Anderson

    you get the appropriate name like this:

    idx = parseInt(thisComp.name.split(" ")[1],10) - 1;

    footage(data.csv").dataValue([0,idx]) // result = Rob Smith for Comp 2

  • Dan Ebberts

    October 28, 2020 at 12:08 am in reply to: Why this expression breaks with the new JavaScript?

    As far as I know, expressions don’t have access to the comments. So what’s actually in your text file, and what do your comp names look like?

    Dan

Page 129 of 1081

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