Forum Replies Created

Page 85 of 1081
  • I guess you could repeat the process and add another fill color animator and another expression selector, then change the expression for the first selector to:

    (textIndex-1)%3 == 1 ? 100 : 0

    and set the expression for the second one to:

    (textIndex-1)%3 == 2 ? 100 : 0

    Extrapolate the process for more colors. For four colors the first expression would become:

    (textIndex-1)%4 == 1 ? 100 : 0

    etc.

  • Type your text in the color you want letters 1,3,5… to be. Add a RGB Fill Color Animator and set the color to the color you want for letters 2,4,6…, add an Expression Selector and set Based On to Characters (or Characters Excluding Spaces) and set the Amount expression to this:

    textIndex%2 ? 0 : 100
  • Dan Ebberts

    June 21, 2022 at 4:23 pm in reply to: Slider Control Incrementing up Every Marker

    I’d do it like this:

    moveTime = .5;

    moveAmount = 40;

    m = marker;

    scroll = 0;

    if (m.numKeys > 0){

    n= m.nearestKey(time).index;

    if (time < m.key(n).time) n--;

    if (n > 0){

    t = time - m.key(n).time;

    scroll = (n-1)*moveAmount + linear(t, 0, moveTime, 0, moveAmount);

    }

    }

    scroll

  • Dan Ebberts

    June 20, 2022 at 9:50 pm in reply to: Scripting Layer Color

    I think you do have to go after the color of the solidsource for the null (rather than the color of the layer itself), but it’s not as tricky as I thought. This should work:

    var myNull = app.project.activeItem.layer(1);

    myNull.source.mainSource.color = [1,1,0];

  • Dan Ebberts

    June 19, 2022 at 9:10 pm in reply to: Trigger Two Keyframes With Alpha – not working

    I think the easiest way would be to apply the keyframe overshoot expression to the slider and then change this line:

    while ((t < t2 - t1) && t <= time){

    to this:

    while ((t < (t2 - t1)*3) && t <= time){

    in the sampleImage() expression.

  • Dan Ebberts

    June 19, 2022 at 2:47 pm in reply to: Trigger Two Keyframes With Alpha – not working

    What does your expression, in its final form, look like?

  • Dan Ebberts

    June 19, 2022 at 2:28 am in reply to: Shift an audio track in the timeline

    I think you just need to get rid of the quotes around the variable name in the second line:

    b = comp("animatic").layer(a).startTime;
  • Dan Ebberts

    June 18, 2022 at 8:52 pm in reply to: Trigger Two Keyframes With Alpha – not working

    I can’t picture how that error is even possible with the expression, as written, because if the expression detects no keyframes, it would fail on the previous line and complain about there being no keyframe number 1. In any case, you could defend against the error message by encasing the the whole thing in a test for two or more keyframes, like this:

    if (numKeys > 1){

    sampleSize = [1,1];

    L = thisComp.layer("Alpha Scale");

    P = L.fromComp(toComp(anchorPoint));

    lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time))[2];

    t = 0;

    t1 = key(1).time;

    t2 = key(numKeys).time;

    if (lum == 1){

    t = thisComp.frameDuration

    while ((t < t2 - t1) && t <= time){

    lTemp = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time-t))[2];

    if (lTemp < 1){

    t -= thisComp.frameDuration;

    break;

    }

    t += thisComp.frameDuration;

    }

    }

    valueAtTime(t1 + t);

    }else

    value

  • Dan Ebberts

    June 18, 2022 at 4:55 pm in reply to: Trigger Two Keyframes With Alpha – not working

    This might not be exactly right (depending on how you have things set up), but probably something like this:

    sampleSize = [1,1];

    L = thisComp.layer("Alpha Scale");

    P = L.fromComp(toComp(anchorPoint));

    lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time))[2];

    t = 0;

    t1 = key(1).time;

    t2 = key(numKeys).time;

    if (lum == 1){

    t = thisComp.frameDuration

    while ((t < t2 - t1) && t <= time){

    lTemp = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time-t))[2];

    if (lTemp < 1){

    t -= thisComp.frameDuration;

    break;

    }

    t += thisComp.frameDuration;

    }

    }

    valueAtTime(t1 + t);

  • Dan Ebberts

    June 17, 2022 at 6:49 pm in reply to: Scripting Layer Color

    The only thing I can think of would be to do a replaceWithSolid() on the null’s source and specify the color you want, like this:

    var myNull = app.project.activeItem.layer(1);

    var myFootage = myNull.source;

    myFootage.replaceWithSolid([1,0,0],myFootage.name,myFootage.width,myFootage.height,myFootage.pixelAspect);

Page 85 of 1081

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