Forum Replies Created

Page 2 of 1081
  • Dan Ebberts

    March 6, 2026 at 3:34 pm in reply to: Expression to animate Along Motion Path

    2D? If so, try this:

    p = position;
    n = p.numKeys;
    if (n > 0){
    if (time < p.key(1).time){
    v = p.velocityAtTime(p.key(1).time);
    }else if (time > p.key(n).time){
    v = p.velocityAtTime(p.key(n).time);
    }else{
    v = p.velocity;
    }
    }else{
    v = p.velocity;
    }
    radiansToDegrees(Math.atan2(v[1],v[0]))
  • I don’t remember where I got that formula (I don’t think I derived it), but this might help with the math:

    https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves

  • I think the actual formula for the “magic number” is:

    (4/3)*(Math.SQRT2 - 1)

    which comes out to about .5523. You were pretty close!

  • Dan Ebberts

    January 9, 2026 at 4:27 am in reply to: Random Initial Scale plus wiggle scale

    In most cases, the result of the expression replaces the static/keyframed value of the property, but wiggle() is a special case. The pre-expression value is included in the result, with the wiggle amount (+ or -) being added to it. So if you’re just interested in the wiggle part, you need to subtract value to isolate the wiggle.

  • Dan Ebberts

    January 9, 2026 at 12:42 am in reply to: Random Initial Scale plus wiggle scale

    I haven’t tested this, but you might just need to separate the wiggle from the original value by changing this:

    w= wiggle(f,a);

    to this:

    w= wiggle(f,a) - value;
  • Dan Ebberts

    December 7, 2025 at 5:48 pm in reply to: Weird marker behavior

    Does it make any difference if instead of this:

    myFrame=time/thisComp.frameDuration+1;

    you use this:

    myFrame=timeToFrames(time)+1;
  • Dan Ebberts

    December 4, 2025 at 7:54 pm in reply to: Checkbox fixed text leading
    That's exactly what it is. It's the JavaScript ternary (or conditional) operator. So if cb is true (1 in this case) the result is 90, otherwise it's 77.7.
  • What is it that you’re trying to do?

  • I’m not sure what you want to do with the result, but this expression will fill the frames array with all the frames where a close encounter first occurs. However, on each frame, this expression has to examine the entire comp, so you might want to consider converting the expression to keyframes at some point if processing time becomes an issue:

    var rangeMin = 100;
    var posDistance = effect("Shortest Distance")("Slider");
    frames = [];
    inRange = false;
    for (i = 0; i <= timeToFrames(thisComp.duration); i++) {
    if (inRange){
    if (posDistance.valueAtTime(framesToTime(i)) > rangeMin){
    inRange = false;
    }
    }else{
    if (posDistance.valueAtTime(framesToTime(i)) <= rangeMin){
    frames.push(i);
    inRange = true;
    }
    }
    }
  • Dan Ebberts

    December 2, 2025 at 5:31 pm in reply to: Checkbox fixed text leading

    I think that will look something like this:

    cb = thisComp.layer("Expression_Ctrls").effect("Checkbox Control")("Checkbox").value;
    leading = cb ? 90 : 77.7;
    text.sourceText.style
    .setFontSize(thisComp.layer("Expression_Ctrls").effect("SLIDER-3_REGELS")("Slider"))
    .setAutoLeading(false)
    .setLeading(thisComp.layer("Expression_Ctrls").effect("SLIDER-3_REGELS")("Slider")/100*leading)
    .setAllCaps(true);


Page 2 of 1081

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