Forum Replies Created

Page 67 of 1081
  • Dan Ebberts

    November 22, 2022 at 10:38 pm in reply to: Script Dropdown to change Effect Dropdown

    Maybe the first line needs to be:

    var myType = myLayers[i].effect("Make Selection")("Type").value;
  • There are a number of different options. One would be to use the slider to set the duration of the out animation, like this time remapping expression:

    dur = effect("Slider Control")("Slider");
    t1 = key(1).time;
    t2 = t1 + dur;
    v1 = key(1).value;
    v2 = key(2).value;
    linear(time,t1,t2,v1,v2)
  • Dan Ebberts

    November 21, 2022 at 11:02 pm in reply to: Expression that triggers on a new frame in a sequence

    The only tool expressions might have for something like that would be sampleImage(), but it would be ridiculously slow. You could do it using the plugin API, but that’s a steep learning curve. You’d probably be better off marking such trigger points by hand with layer markers or keyframes and have the expression triggered that way.

  • Dan Ebberts

    November 21, 2022 at 7:39 am in reply to: Multiple checkbox expressions

    So is your intention for the expression to accommodate all 16 permutations of multiple checkboxes selected or do you want it to work like radio buttons, where only one of the four options can be selected at a time? If it’s radio buttons, you’d be better off using a Dropdown Menu Control and an expression structured like this (I don’t think this is right, but I don’t really understand how it’s supposed to work):

    menu = effect("Dropdown Menu Control")("Menu").value;
    switch (menu){
    case 1:
    speedMultiplier = -5;
    y = value[0];
    x = value[1] + time * speedMultiplier;
    break;
    case 2:
    speedMultiplier = 5;
    y = value[0];
    x = value[1] + time * speedMultiplier;
    break;
    case 3:
    speedMultiplier = 5;
    x = value[0];
    y = value[1] + time * speedMultiplier;
    break;
    case 4:
    speedMultiplier = -5;
    x = value[0];
    y = value[1] + time * speedMultiplier;
    break;
    default:
    x = value[0];
    y = value[1];
    break;
    }
    [x,y]
  • Dan Ebberts

    November 20, 2022 at 7:02 pm in reply to: Insert Line Break every X number of characters

    Do you just need to split it into 2 pieces if it’s too long? If so, see if this works for you:

    txt = thisComp.layer("Captions").text.sourceText.value;
    dist = thisComp.layer("Captions").sourceRectAtTime().width;
    Wguide = thisComp.layer("width guide").effect("Slider Control")("Slider")
    len = txt.length;
    outStr = txt;
    if (dist > Wguide){
    if (len%2){
    i = Math.floor(len/2);
    j = i;
    }else{
    j = len/2;
    i = j - 1;
    }
    while (i >= 0 && j < len){
    if (txt[j] == " "){
    outStr = txt.substr(0,j) + "\r" + txt.substr(j+1);
    break;
    }
    if (txt[i] == " "){
    outStr = txt.substr(0,i) + "\r" + txt.substr(i+1);
    break;
    }
    i--;
    j++;
    }
    }
    outStr
  • Dan Ebberts

    November 19, 2022 at 9:10 pm in reply to: Slider Value Ratio

    You might want to add a ratio slider that would get used when the checkbox is on.

  • Dan Ebberts

    November 19, 2022 at 8:21 pm in reply to: Slider Value Ratio

    I’m assuming this expression would be applied to the height slider, is that correct? If so, then I think your ratio is backwards (should be height/width) but I don’t think it will work because both sides of your conditional calculate out to the same value (which is the current value of the height slider).

  • Dan Ebberts

    November 18, 2022 at 6:37 pm in reply to: Fade Out at Marker End

    I’m assuming this is a source text expression, correct? If so, change it to this:

    m = thisLayer.marker;
    n = 0;
    val = "";
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if (n > 0){
    val = m.key(n).comment;
    }
    val

    and add this opacity expression:

    m = thisLayer.marker;
    f = framesToTime(5);
    n = 0;
    val = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if (n > 0){
    t = time - m.key(n).time;
    d = m.key(n).duration;
    val = linear(t,d,d+f,100,0);
    }
    val

  • Dan Ebberts

    November 16, 2022 at 10:42 pm in reply to: text length before and after a return

    Ah, the second expression has a typo. Try it this way:

    x= thisComp.layer("TITRE").sourceRectAtTime(-1).width;
    y= thisComp.layer("TITRE").sourceRectAtTime(-2).width;
    v= (1920-(x*.56))/-2+1366;
    w= (1920-(y*.56))/-2+1366;
    y > x ? w : v+20
  • Dan Ebberts

    November 16, 2022 at 7:03 pm in reply to: text length before and after a return

    If you do the negative time trick, so just your first line shows up at time = -1 and the just the second line shows up at time = -2 (with a source text expression like this):

    if (time < 0){
    txt = value.split("\r");
    if (txt.length > 1 && time < -1.5){
    txt[1];
    }else{
    txt[0];
    }
    }else
    value

    Then your expression, modified like this should work:

    x= thisComp.layer("TITRE").sourceRectAtTime(-1).width;
    y= x= thisComp.layer("TITRE").sourceRectAtTime(-2).width;
    v= (1920-(x*.56))/-2+1366;
    w= (1920-(y*.56))/-2+1366;
    y > x ? w : v+20
Page 67 of 1081

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