Forum Replies Created

Page 150 of 1081
  • Dan Ebberts

    April 20, 2020 at 2:46 pm in reply to: Get the completion of a slider

    Maybe something like this:

    s = thisComp.layer(“Control”).effect(“Slider Control”)(“Slider”);
    pct = linear(s,70,100,0,100) + “%”;

    Dan

  • Dan Ebberts

    April 19, 2020 at 6:20 am in reply to: Expression count up values in specific time

    It seems like the value of the slider doesn’t matter, just the index of the most recent keyframe. It will probably looks something like this:


    s = comp("MainComp").layer("Value Control").effect("Value 1")("Slider");
    v = value;
    if (s.numKeys > 0){
    n = s.nearestKey(time).index;
    if (time < s.key(n).time) n--;
    if (n > 0){
    if (n ==1){
    v = footage("Values.csv").dataValue([2,0]);
    }else{
    t = time - s.key(n).time;
    v1 = footage("Values.csv").dataValue([2,n-2]);
    v2 = footage("Values.csv").dataValue([2,n-1]);
    v = linear(t,0,1,v1,v2);
    }
    }
    }
    v

    Dan

  • Dan Ebberts

    April 19, 2020 at 4:41 am in reply to: Expression count up values in specific time

    The key to making something like this work is that your expression has to be able to figure out when the slider changed to a particular value. Do you have a keyframe for each slider value? If so, it’s fairly straighforward. If not, it’s more cumbersome, but it can still be done. So how are you driving the slider values, exactly?

    Dan

  • Dan Ebberts

    April 17, 2020 at 5:17 pm in reply to: Expression Error – Auto-Scaling text

    This line:

    leeway = 100 — percentageOfMaxWidth;

    has an illegal character in it for the subtract operator. It should be:

    leeway = 100 – percentageOfMaxWidth;

    Dan

  • Dan Ebberts

    April 16, 2020 at 3:11 pm in reply to: Counter rounding and then no rounding?

    Something like this maybe:

    timeA = 0;
    timeB = 1;
    val = Math.round(linear(time, timeA,timeB, 0, 3.9));
    (val > 3 ? 3.9 : val)+’%’

    Dan

  • Dan Ebberts

    April 15, 2020 at 6:20 pm in reply to: Over riding two If/Else statements

    If variable Line1 is false (corresponding checkbox unchecked), it skips the 1666.5 and moves to the else if part. If variable Line1 is true, it accepts 1666.5 as the result, and ignores the else if and else parts.

    Dan

  • Dan Ebberts

    April 15, 2020 at 6:00 pm in reply to: Over riding two If/Else statements

    Yes, the value of a checkbox evaluates to true if checked, false if unchecked.

    Dan

  • Dan Ebberts

    April 15, 2020 at 12:40 am in reply to: wiggle loop scale expression problem

    Try changing the last line to:

    w = linear(t, 0, loopTime, wiggle1, wiggle2);
    [w[0],w[0]]

    Dan

  • Dan Ebberts

    April 14, 2020 at 7:37 pm in reply to: Over riding two If/Else statements

    You could combine them like this:

    Line1 = effect(“Single Line Position”)(“Checkbox”).value;
    Line2 = effect(“2 Line Position”)(“Checkbox”).value;

    if(Line1)1666.5
    else if(Line2)1582.5
    else value

    Note that Line 1 will have priority if both checkboxes are checked.

    Dan

  • Dan Ebberts

    April 14, 2020 at 6:31 pm in reply to: changing text color within a “tag”

    Where are you applying the expression? It needs to go on the Amount property of an Expression Selector.

    Dan

Page 150 of 1081

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