Forum Replies Created

Page 153 of 1081
  • Dan Ebberts

    March 12, 2020 at 4:35 pm in reply to: Creating a Shape Path Tween

    I think this will work:


    p1 = content("Shape 1").content("Path 1").path;
    p2 = content("Shape 2").content("Path 1").path;
    v1 = p1.points();
    v2 = p2.points();
    tIn1 = p1.inTangents();
    tIn2 = p2.inTangents();
    tOut1 = p1.outTangents();
    tOut2 = p2.outTangents();
    v = [];
    tIn = [];
    tOut = [];
    for (i = 0; i < v1.length; i++){
    v[i] = (v1[i]+v2[i])/2;
    tIn[i] = (tIn1[i]+tIn2[i])/2;
    tOut[i] = (tOut1[i]+tOut2[i])/2;
    }
    createPath(v,tIn,tOut,p1.isClosed())

    Dan

  • Dan Ebberts

    March 10, 2020 at 12:24 am in reply to: Expression result must be of dimension 2, not 1

    It looks like you left off the last line:

    value – [0,y]

    Dan

  • Dan Ebberts

    March 9, 2020 at 12:33 am in reply to: Wiggle Expressions

    I think you’d just replace

    value;

    with

    100;

    Dan

  • Dan Ebberts

    March 8, 2020 at 8:26 pm in reply to: Find angle of auto-oriented layer

    Try this:

    L = thisComp.layer(“Layer 1”);
    v = L.toCompVec([1,0]);
    radiansToDegrees(Math.atan2(v[1],v[0]))

    Dan

  • Dan Ebberts

    March 4, 2020 at 10:53 pm in reply to: Index of thiscomp

    What do you mean by pre-comp B index? Do you mean the layer index of the pre-comp B layer within precomp A? Something like this:

    comp(“precomp A”).layer(thisComp.name).index

    Dan

  • Dan Ebberts

    March 4, 2020 at 10:26 pm in reply to: Expression to split text

    You could do something like this:

    txt = thisComp.name.split(“/”);
    txt[0] + “\r” + txt[1] + ” ” + txt[2]

    but you’ll lose the individual formatting of each word.

    Dan

  • Dan Ebberts

    March 4, 2020 at 5:11 pm in reply to: Q: Looping offset with decreasing/increasing value

    See if this is close:


    if (numKeys > 1){
    if (time < key(2).time){
    value;
    }else{
    r = key(1).value/key(2).value;
    d = key(2).time - key(1).time;
    t = (time - key(2).time)%d;
    n = Math.floor((time - key(2).time)/d);
    valueAtTime(key(1).time + t)/Math.pow(r,n+1);
    }
    }else
    value

    Dan

  • Dan Ebberts

    March 2, 2020 at 9:42 pm in reply to: Change Keyframe Color Based on Expression

    How about something like this:


    c1 = effect("Color Control")("Color");
    c2 = effect("Color Control 2")("Color");
    val = value;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (time < key(n).time)n--;
    if (n > 0){
    val = (n%2 > 0) ? c1 : c2;
    }
    }
    val

    Dan

  • Dan Ebberts

    March 1, 2020 at 1:32 am in reply to: Decode text every 2 frames

    Like this maybe:


    c = ['D','C','B','N','M','T'];
    s = "";
    for(x=0; x < value.length; x++){
    r = Math.floor(random(0, c.length));
    s += c[r];
    }
    f = timeToFrames(time);
    n = Math.floor(f/2);
    value.substr(0,n) + s.substr(n)

    Dan

  • Dan Ebberts

    February 28, 2020 at 11:38 pm in reply to: Count number of markers with the same name

    This should work:


    L = thisComp.layer("your_marker_layer");
    m = L.marker;
    count = 0;
    for (i = 1; i <= m.numKeys; i++){
    if (m.key(i).comment == "POS") count++;
    }
    count

    Dan

Page 153 of 1081

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