Forum Replies Created

Page 5 of 1081
  • Roland,

    I’m guessing that some unintentional reformatting occurred when you posted your code. I’m taking a shot at what I think you might have intended here:

    let layerNames = "";
    for (let i = 1; i <= thisComp.numLayers; i++) {
    if (i === index) continue;
    let targetLayer = thisComp.layer(i);
    if (targetLayer.active) {
    layerNames += targetLayer.index + " - " + targetLayer.name + "\r\n";
    }
    }
    layerNames.trim();
  • My guess is that the “Adjust composition duration to the time span of the selected layers” switch in the pre-compose dialog is moving your resulting, shortened precomp off to the left on the time line so that it’s not visible.

  • Dan Ebberts

    May 21, 2025 at 12:50 pm in reply to: Check for shortest distance

    This could get complicated, depending on what you’re after, but the simplest version would probably be something like this:

    posterizeTime(0);
    p1 = thisComp.layer("Shape Layer 1").content("Rectangle 1").transform.position;
    p2 = thisComp.layer("Shape Layer 1").content("Rectangle 2").transform.position;
    minD = length(p1.valueAtTime(0),p2.valueAtTime(0));
    for (i = 1; i < timeToFrames(thisComp.duration); i++){
    t = framesToTime(i);
    d = length(p1.valueAtTime(t),p2.valueAtTime(t));
    minD = Math.min(d, minD);
    }
    minD
  • Dan Ebberts

    May 21, 2025 at 3:46 am in reply to: Checkbox controlled Keyframe value

    This would be one way:

    checkboxOn=thisComp.layer("CHECKBOX-CTRL").effect("BLUR-ON_OFF")("Checkbox").value;
    keyframeValue=15;
    k1 = key(1).time;
    k2 = key(2).time;
    k3 = key(3).time;
    k4 = key(4).time
    if (checkboxOn){
    if (time < (k2 + k3)/2){
    ease(time,k1,k2,valueAtTime(k1),keyframeValue);
    }else{
    ease(time,k3,k4,keyframeValue,valueAtTime(k4));
    }
    }else
    value
  • Dan Ebberts

    May 20, 2025 at 7:02 pm in reply to: Checkbox controlled Keyframe value

    Maybe start with something like this:

    checkboxOn=thisComp.layer("CHECKBOX-CTRL").effect("BLUR-ON_OFF")("Checkbox").value;
    keyframeValue=15;
    k1 = key(1).time;
    k2 = key(2).time;
    if (checkboxOn){
    ease(time,k1,k2,valueAtTime(k1),keyframeValue);
    }else
    value
  • Dan Ebberts

    May 20, 2025 at 3:10 pm in reply to: Checkbox controlled Keyframe value

    So what is it that you want the checkbox to do, exactly?

  • Dan Ebberts

    May 17, 2025 at 4:00 pm in reply to: Overshoot Bounce Out Expression Needed!

    To run it in reverse, you need to define an end point, so you could introduce a new variable, totalDur, for that purpose, and modify one line of the expression to reverse it, like this:

    freq = 3;
    decay = 5;
    totalDur = 3;
    t = (inPoint +totalDur) - time;
    startVal = [0,0];
    endVal = [200,200];
    dur = 0.1;
    if (t < dur){
    linear(t,0,dur,startVal,endVal);
    }else{
    amp = (endVal - startVal)/dur;
    w = freq*Math.PI*2;
    endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);
    }

    You could tie any of the variables (first 3 lines) to sliders.

  • You were close. Try it this way:

    var compLength = thisComp.duration / thisComp.frameDuration;
    var posX = thisComp.layer("shape").transform.xPosition;
    for (i = 0; i <= compLength; i++) {
    if (posX.valueAtTime(framesToTime(i)) >= 500) break;
    }
    i
  • You could try a scale expression like this, to counteract the scaling of the parent shape layer:

    s = parent.scale;
    [value[0]/s[0],value[1]/s[1]]*100

    You might need to move the text layer’s anchor point to the bottom of the shape layer to keep gap from changing size as the shape scales.

  • I’m probably missing something, but I get fully saturated colors if I have the Color Balance (HLS)’s Lightness set to 0 and the Saturation set to 100. I only get white if I move Lightness to 100.

Page 5 of 1081

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