Forum Replies Created

Page 128 of 1081
  • Dan Ebberts

    November 22, 2020 at 2:44 pm in reply to: How to edit this expression

    Which expression is it?

  • something like this maybe:

    L = thisComp.layer("target");

    falloff = 200;

    d = length(toComp(anchorPoint),L.toComp(L.anchorPoint));

    linear(d,0,falloff,100,0)

  • Dan Ebberts

    November 20, 2020 at 6:34 pm in reply to: Automate Numbers

    Something like this should work:

    n = 10; // number of layers participating

    count = 0;

    for (i = 1; i <= Math.min(thisComp.numLayers,n); i++){

    if (thisComp.layer(i).enabled) count++;

    if (i >= index) break;

    }

    count

  • Dan Ebberts

    November 18, 2020 at 8:47 pm in reply to: Graph Animation Problem

    It’s not particularly simple, but if your graph is a function of x (never loops back so there are multiple values of y for the same x), a binary search like this should work:

    x = thisComp.layer("Vertical Line").transform.position[0];

    L = thisComp.layer("Graph");

    p = L.content("Shape 1").content("Path 1").path;

    iterations = 12;

    p0 = L.toComp(p.pointOnPath(0));

    p1 = L.toComp(p.pointOnPath(1));

    if (x < p0[0]){

    p0;

    }else if (x > p1[0]){

    p1;

    }else{

    lower = 0;

    mid = .5;

    upper = 1.0;

    for ( i = 0; i < iterations; i++){

    pCur = L.toComp(p.pointOnPath(mid));

    if (pCur[0] == x) break;

    if (pCur[0] > x){

    upper = mid;

    }else{

    lower = mid

    }

    mid = (upper+lower)/2;

    }

    pCur

    }

  • Dan Ebberts

    November 18, 2020 at 5:26 pm in reply to: Make property Value move in increments of 10

    Math.floor rounds down to the nearest integer, Math.round rounds to the nearest integer.

  • Dan Ebberts

    November 18, 2020 at 4:53 pm in reply to: Make property Value move in increments of 10

    Like this:

    SK = thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1");

    Math.floor(SK/10)*10

    or this:

    SK = thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1");

    Math.round(SK/10)*10

  • Try this:

    m = marker;

    t = linear(time,m.key(1).time,m.key(2).time,key(1).time,key(4).time);

    valueAtTime(t)

  • Dan Ebberts

    November 12, 2020 at 11:51 pm in reply to: Extract scale values from matrix (toWorldVec)?

    Try this:

    [100/length(u),100/length(v),100/length(w)]
  • Dan Ebberts

    November 6, 2020 at 2:12 am in reply to: Text Expression Selector “Invert range”

    Try changing the 6th line to:

    myDelay = (textTotal - textIndex)*delay;
  • Dan Ebberts

    November 5, 2020 at 11:04 pm in reply to: time expression

    That’s quite different. This should work, but it might become a processor hog if your comp gets too long:

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

    threshold = 5;

    tStart = 0;

    runFrames = 0;

    f = timeToFrames(time);

    while (f >= 0 ){

    if (aud.valueAtTime(framesToTime(f)) > threshold){

    runFrames++;

    }

    f--;

    }

    tStart + framesToTime(runFrames)

Page 128 of 1081

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