Forum Replies Created

Page 71 of 1081
  • Dan Ebberts

    October 22, 2022 at 11:42 pm in reply to: Typewriter forward then reverse

    Assuming you’re applying this to a text layer’s source text, I think this does what you want:

    Speed = 20;
    t = time < (inPoint+outPoint)/2 ? time - inPoint : outPoint - time;
    value.substr(0,t*Speed)
  • Dan Ebberts

    October 22, 2022 at 4:05 pm in reply to: Seed option for noise

    noise() is a 3D Perlin noise field that accepts a number or a 2 or 3 item array as its input. So you could do something like this:

    noiseMulti = 10;
    fr = 10;
    amp = 200
    seed = 1268;
    n = noise([time*fr,seed])*amp*noiseMulti;
    [0,n]
  • Dan Ebberts

    October 22, 2022 at 12:21 am in reply to: Need to trigger animation any time there is a marker.

    This would animate between the keyframes, except for the last one, where it would use your previous timing:

    m = text.sourceText;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if (n > 0){
    t1 = m.key(n).time;
    if (n < m.numKeys){
    t2 = m.key(n+1).time;
    }else{
    t2 = t1 + .5;
    }
    ease (time,t1,t2,0,100);
    }else
    0
  • I think that would actually be a little simpler (if I’m understanding what you’re describing), like this:

    L = thisComp.layer("Difference Matte Layer");
    count = 0;
    f = timeToFrames(time);
    for (i = 0; i <= f; i++){
    s = L.sampleImage([L.width,L.height]/2,[L.width,L.height]/2,true,framesToTime(i));
    if ((s[0]+s[1]+s[2]) > 0) count++;
    }
    count
  • I don’t know how practical it is (because it uses sampleImage(), which can bring your system to its knees), but this should start a counter (which you could use to drive a triggered action) whenever it detects something in your Difference Matte layer:

    L = thisComp.layer("Difference Matte Layer");
    tRun = 0;
    s = L.sampleImage([L.width,L.height]/2,[L.width,L.height]/2);
    trig = (s[0]+s[1]+s[2]) > 0;
    t = time - thisComp.frameDuration;
    while (t >= 0){
    s = L.sampleImage([L.width,L.height]/2,[L.width,L.height]/2,true,t);
    if (trig){
    if (s[0]+s[1]+s[2] == 0){
    tRun = time - t;
    break;
    }
    }else{
    trig = (s[0]+s[1]+s[2]) > 0;
    }
    t -= thisComp.frameDuration;
    }
    tRun
  • Dan Ebberts

    October 21, 2022 at 3:36 pm in reply to: Need to trigger animation any time there is a marker.

    Sure, but what should happen at the last marker?

  • Dan Ebberts

    October 20, 2022 at 8:15 pm in reply to: Scripting – Set Layer Selection

    So you did change from .value to .text in your myIndex definition and it didn’t help?

  • Dan Ebberts

    October 20, 2022 at 4:11 pm in reply to: Scripting – Set Layer Selection

    Depending on what edittext1 is, it might be:

    var myIndex = parseInt(edittext1.text,10);

  • Dan Ebberts

    October 20, 2022 at 3:28 pm in reply to: Scripting – Set Layer Selection

    That seems like the correct syntax, unless there’s something unusual going on. Maybe you can post a screen shot?

  • Dan Ebberts

    October 19, 2022 at 3:20 pm in reply to: using if else to set a variable

    The JavaScript engine won’t accept if/else on a single line in that format. I’d do it like this:

    a = comp("precomp").layer("title").active ? b : c;
Page 71 of 1081

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