Forum Replies Created

Page 147 of 1081
  • Dan Ebberts

    May 2, 2020 at 9:39 pm in reply to: Scale in + out based on layer length

    Actually, you can leave all that layer name/index stuff out:


    startScale = [0,0];
    endScale = [100,100];

    if(time < (inPoint+outPoint)/2)
    ease(time,inPoint,inPoint+0.2,startScale,endScale)
    else
    ease(time,outPoint-0.2,outPoint,endScale,startScale);

    Dan

  • Dan Ebberts

    May 1, 2020 at 8:49 pm in reply to: Array with color values changing by time

    Try this:

    c1 = [1,0,0,1]; // red
    c2 = [1,.5,0,1]; // orange
    c3 = [1,1,0,1]; // yellow
    c4 = [0,1,0,1]; // green
    c5 = [0,1,1,1]; // cyan
    c6 = [0,0,1,1]; // blue
    colors = [c1,c2,c3,c4,c5,c6,c5,c4,c3,c2];
    secondsPerColor = 1;
    idx = Math.floor((time – inPoint)/secondsPerColor)%colors.length;
    colors[idx]

    Dan

  • Something like this should work:

    seedRandom(Math.floor(time), timeless = true);
    c1=thisComp.layer(“Null 1”).effect(“Color Control”)(“Color”);
    c2=thisComp.layer(“Null 1”).effect(“Color Control 2”)(“Color”);
    c3=thisComp.layer(“Null 1”).effect(“Color Control 3”)(“Color”);
    c4=thisComp.layer(“Null 1”).effect(“Color Control 4”)(“Color”);
    c5=thisComp.layer(“Null 1”).effect(“Color Control 5”)(“Color”);
    c6=thisComp.layer(“Null 1”).effect(“Color Control 6”)(“Color”);
    idx = Math.floor(random(6))+1;
    eval(“c” + idx)

    Dan

  • That’s pretty much it. They way you had it, the expression in layer n requires the expression engine to recalculate the expression in layer n-1, which requires recalculation of layer n-2, and so on, increasing geometrically with the number of layers. It can bog things down in a hurry.

    Dan

  • I think you’ll get better performance if you avoid a cascading expression (where each expression depends on the result from the expression in the previous layer) and just use a straight ahead calculation based on layer index, like this (not tested):
    thisComp.layer(2).transform.xPosition + (index-2)*thisComp.layer(“Control”).effect(“Distance”)(“Slider”)

    Dan

  • Dan Ebberts

    April 29, 2020 at 10:57 pm in reply to: Change color of the shape by text value

    This should be closer:

    txt = thisComp.layer(“Text”).text.sourceText;
    parseFloat(txt) < 50 ? [0,1,0,1] : [1,0,0,1]

    Dan

  • Dan Ebberts

    April 29, 2020 at 9:47 pm in reply to: Change color of the shape by text value

    I think this does what you’re asking for. I’m not sure it’s what you meant though.

    txt = thisComp.layer(“Text”).text.sourceText;
    txt == “50%” ? [0,1,0,1] : [1,0,0,1]

    Dan

  • Dan Ebberts

    April 29, 2020 at 8:58 pm in reply to: Control the size of one keyframe.

    Try it like this:


    sVal = thisComp.layer("Adjustment Layer 2").effect("Slider Control")("Slider");
    if (time < key(2).time)
    x = easeOut(time,key(1).time,key(2).time,key(1).value[0],sVal)
    else if (time < key(3).time)
    x = linear(time,key(2).time,key(3).time,sVal,sVal-11)
    else
    x = linear(time,key(3).time,key(4).time,sVal-11,sVal);
    [x,value[1]]

    Dan

  • Dan Ebberts

    April 29, 2020 at 2:10 pm in reply to: Refer to a value outside of the comp

    Sure. It might look something like this:

    pct = comp(“Controls”).layer(“Controls”).effect(“Percent”)(“Slider”);
    seedRandom(index,true);
    random() < pct/100? 100 : 0

    Dan

  • You could add a minDelay variable, like this:

    minDelay = 3; // shapes wait at least 3 seconds to turn on
    maxDelay = 5; // all shapes turn on within 5 seconds
    seedRandom(index,true);
    myDelay = random(minDelay,maxDelay);
    time – inPoint < myDelay ? 0 : 100

    then adjust the first two lines to suit.

    Dan

Page 147 of 1081

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