Forum Replies Created

Page 127 of 1081
  • Dan Ebberts

    December 1, 2020 at 4:56 pm in reply to: problem creating a wiggle range in position

    Try changing this:

    y = linear(w,-20,20,minY,maxY);

    to this:

    y = linear(w[1],-20,20,minY,maxY);
  • Probably something like this:

    L = thisComp.layer("CONTROL SCRIPT");

    dur = L.effect("Slider Control")("Slider");

    point = L.effect("Point Control")("Point");

    if (numKeys > 1){

    t1 = key(1).time;

    t2 = t1 + dur;

    v1 = key(1).value;

    v2 = L.toComp(point);

    linear(time,t1,t2,v1,v2);

    }else

    value

  • Dan Ebberts

    November 26, 2020 at 4:43 pm in reply to: link timeremap frame number to twixtor frame number

    Internally, the time remap value is always in seconds, so you just need to do this:

    timeToFrames(thisComp.layer("BEAUTY 2").timeRemap)
  • Dan Ebberts

    November 26, 2020 at 7:18 am in reply to: Make this expression works with specific marker key

    Something like this:

    markerNum = 2;

    attackTime = .1;

    holdTime = .1;

    decayTime = .25;

    val = 0;

    if (marker.numKeys >= markerNum){

    t = time - marker.key(markerNum).time;

    t1 = attackTime;

    t2 = t1 + holdTime;

    t3 = t2 + decayTime

    if (t < t1)

    val = linear(t,0,t1,0,100)

    else if (t < t2)

    val = 100

    else

    val = linear(t,t2,t3,100,0);

    }

    val

  • Dan Ebberts

    November 24, 2020 at 12:27 am in reply to: Move a layer according to its own location

    Generally, you have to convert the calculation to be time-based. If you can’t come up with a formula based on the current time (or frame number) then you can use the brute-force method, where you start at time = 0 and loop frame-by-frame to calculate the current result. Your example would look something like this:

    val = valueAtTime(0);

    f = 1;

    while (f <= timeToFrames(time)){

    val += val[0]%2 ? [0,1] : [0,-1];

    val += val[1]%3 == 0 ? [1,0] : [-1,0];

    f++;

    }

    val

  • Dan Ebberts

    November 23, 2020 at 11:34 pm in reply to: Move a layer according to its own location

    The way expressions work is that an expression can only access the pre-expression value of the property hosting the expression. That means an expression has no access to results it calculated on other frames, only the keyframed (or static) value.

    However, when an expression accesses the value of any other property, it gets the post-expression value of that property.

    Depending on what you’re trying to do, there are usually ways to work around these “limitations”. However, if what you’re trying to do involves one or more expressions that affect the results of each other (creating a feedback loop) you may be in for disappointment.

  • Dan Ebberts

    November 23, 2020 at 4:47 pm in reply to: Layer Position Relative to Text Length

    Try changing the 2nd line to:

    L = thisComp.layer("text");

  • Dan Ebberts

    November 22, 2020 at 11:29 pm in reply to: Trying to tally keyframe values

    It’s not too complicated if the expression can expect a slider A keyframe with the value of exactly 5 wherever it needs to tally:

    SliderA = effect("Slider A")("Slider");

    count = 0;

    for (i = 1; i <= SliderA.numKeys; i++){

    if (SliderA.key(i).time > time) break;

    if (SliderA.key(i).value == 5) count++;

    }

    count

    Otherwise, it gets more complex.

  • Dan Ebberts

    November 22, 2020 at 6:35 pm in reply to: How to edit this expression

    That’s still pretty vague. See what you think of this one:

    holdDur = .5;

    minDur = 1.0;

    maxDur = 1.5;

    seedRandom(index,true);

    tNext = tPrev = -random(minDur);

    while (tNext <= time){

    tPrev = tNext;

    tNext += random(minDur,maxDur);

    }

    vMin = [0,0];

    vMax = [thisComp.width,thisComp.height];

    seedRandom(tPrev,true);

    vPrev = random(vMin,vMax);

    seedRandom(tNext,true);

    vNext = random(vMin,vMax);

    ease(time,tPrev,tNext-holdDur,vPrev,vNext);

  • Dan Ebberts

    November 22, 2020 at 3:53 pm in reply to: How to edit this expression

    I don’t see any jumping. What behavior are you looking for exactly?

Page 127 of 1081

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