Forum Replies Created

Page 100 of 1081
  • Dan Ebberts

    January 12, 2022 at 10:50 pm in reply to: Highest Keyframe Value

    Try it this way:

    p = thisComp.layer("Shape Layer 1").transform.position;
    max = p.value[0];
    for (i = 1; i <= p.numKeys; i++){
      max = Math.max(max,p.key(i).value[0]);
    }
    max
  • Dan Ebberts

    January 10, 2022 at 8:51 pm in reply to: valueAtTime() on a REGEX Text Layer

    The while loop just starts at the current frame, and goes back in time, frame by frame, until it finds the most recent frame where the text included the target phrase. It then sets variable t to how long ago that occurred.

  • Dan Ebberts

    January 9, 2022 at 6:10 pm in reply to: valueAtTime() on a REGEX Text Layer

    It’s not clear to me exactly what you’re trying to do, but if variable txt is a string, it seems like you should either use parseInt(txt,10) to convert it to a number, or change your conditional tests to look for characters (“0” or “1”) rather than numbers (0 or 1) .

    Dan

  • Basically, it’s two nested loops. The outer loop examines each layer in the comp. The inner loop looks at the markers for the layer currently being examined. It starts with the most recent, previous marker, and goes backwards in time until it finds a marker with the tag comment (or runs out of markers). If it finds a marker with the tag, it saves the shortest elapsed time for tag markers found on any layer and uses that value to drive the fade in/out animation.

  • Maybe like this:

    fadeInTime = framesToTime(thisComp.layer("CONTROL_politicalParties").effect("FADE IN/OUT")("Slider"));
    fadeOutTime = framesToTime(thisComp.layer("CONTROL_politicalParties").effect("FADE IN/OUT")("Slider"));
    delay = framesToTime(thisComp.layer("CONTROL_politicalParties").effect("DURATION")("Slider"));
    wig = wiggle(thisComp.layer("CONTROL_politicalParties").effect("WIGGLES PER SEC")("Slider"),thisComp.layer("CONTROL_politicalParties").effect("amp_SPD")("Slider"));
    
    tag = "trig";
    t = 999999;
    for (i = 1; i <= thisComp.numLayers; i++){
      s = thisComp.layer(i).marker;
      if (s.numKeys > 0){
        n = s.nearestKey(time).index;
        if (time < s.key(n).time) n--;
        for (j = n; j > 0; j--){
          if (s.key(j).comment == tag){
            t = Math.min(t,time - s.key(j).time);
            break;
          }
        }
      }
    }
    if (t < fadeInTime)
      linear(t,0,fadeInTime,0,wig)
    else
      linear(t,fadeInTime,fadeInTime+delay+fadeOutTime,wig,value);
  • Dan Ebberts

    December 30, 2021 at 4:44 pm in reply to: Script to Sequence Layers (What i’m doing wrong?)

    >Maybe you will tell me: why don’t you use that script that you already have?

    I’m sorry–you lost me. What script are you talking about?

  • Dan Ebberts

    December 30, 2021 at 1:14 pm in reply to: Script to Sequence Layers (What i’m doing wrong?)

    It seems like that would be a bit of a bookkeeping headache. I think you’d have to keep track of the previous layer selection set, then on the next entry, check to see if selLayers is exactly the same as it was last time, and if so, bump a counter that you would then use as a multiplier for i*offset. Might be kind of confusing for the user too (unless it’s just you).

  • Dan Ebberts

    December 30, 2021 at 11:25 am in reply to: Script to Sequence Layers (What i’m doing wrong?)

    Ah, OK. The loop should probably be like this:

    var tStart = selLayers[0].inPoint;
    for (var i = 0; i < selLayers.length; i++)
    {
      selLayers[i].startTime -= selLayers[i].inPoint - tStart - i*offset;
    }
  • Dan Ebberts

    December 29, 2021 at 5:46 pm in reply to: Script to Sequence Layers (What i’m doing wrong?)

    Try changing this:

    selLayers[i].startTime = (selLayers[i].inPoint = selLayers[i].startTime) + i * offset;

    to this:

    selLayers[i].startTime -= selLayers[i].inPoint - i*offset;

  • Dan Ebberts

    December 28, 2021 at 8:11 pm in reply to: How to find 3 triangle angles with 3 sides given

    Like this, I think:

    a =16;
    b = 20;
    c = 18;
    A = radiansToDegrees(Math.acos((b*b + c*c - a*a)/(2*b*c)));
    B = radiansToDegrees(Math.acos((a*a + c*c - b*b)/(2*a*c)));
    C = radiansToDegrees(Math.acos((a*a + b*b - c*c)/(2*a*b)));
Page 100 of 1081

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