Forum Replies Created

Page 116 of 1081
  • It is possible, but it’s probably the most complicated kind of triggering you can do with expressions. Because expressions have no memory, your expression would need to look at every previous frame up to the current time and calculate how many times the triggering condition (mask expansion going from above -231 to below -231, for example) has occurred. Then use that number (or some multiple of it) as the seed for seedRandom() to generate a new random position.

  • Dan Ebberts

    May 2, 2021 at 7:25 pm in reply to: Basic Question from a Novice

    What time expression are you referring to?

  • Dan Ebberts

    May 1, 2021 at 10:44 pm in reply to: Connecting movements inside of a mask to a slider

    You could set up an expression for your mask path, where the height is based on the slider value. This example is more complicated than it needs to be, because I wasn’t sure whether your path goes clockwise or counter-clockwise so the expression allows for either:

    s = effect("Slider Control")("Slider");

    p = thisProperty.points();

    if (p[1][0] < p[3][0]){

    p0 = p[3] - [0,s];

    p1 = p[2] - [0,s];

    newP = [p0,p1,p[2],p[3]];

    }else{

    p0 = p[1] - [0,s];

    p3 = p[2] - [0,s];

    newP = [p0,p[1],p[2],p3];

    }

    createPath(newP,[],[],true)

  • Expressions don’t have memory, so you’d probably need to have separate master controls for each precomp. It sounds like a job better suited to a small script though.

  • Dan Ebberts

    April 27, 2021 at 12:36 am in reply to: Expression Selector: character before/after?

    I think this is what the After would look like:

    a=text.sourceText.value;

    if (textIndex > 1 && a[textIndex-2] == "a") {

    b=a[textIndex-1]; //check letter after the A

    (b=="a" || b=="e" || b=="k" || b=="l" || b=="q" || b=="x" || b=="z") ? 100 : 0;

    }

    else 0

  • Dan Ebberts

    April 26, 2021 at 11:19 pm in reply to: Trigger animation at layer endpoint

    This is an interesting (and tricky) one. What this should give you is that variable “t” will represent how long it’s been since the active layer has changed. You would then use this value to drive your animation. I’m not sure that gives you exactly what you need, but it might give you an idea of how to get there.

    myIdx = 0;

    t = 0;

    for (i = 1; i <= thisComp.numLayers; i++){

    if (i == index) continue; // skip this layer

    L = thisComp.layer(i);

    if (L.enabled && time >= L.inPoint && time < L.outPoint){

    myIdx = L.index;

    break;

    }

    }

    if (myIdx > 0){

    myActive = thisComp.layer(myIdx);

    myTrigger = Math.max(myActive.inPoint,0);

    for (i = 1; i < myIdx; i++){

    if (thisComp.layer(i).enabled && thisComp.layer(i).outPoint <= time){

    myTrigger = Math.max(myTrigger,thisComp.layer(i).outPoint);

    }

    }

    t = time - myTrigger;

    }

    t

  • Dan Ebberts

    April 26, 2021 at 9:00 pm in reply to: Expression Selector: character before/after?

    You were pretty close. I think this will work (as long as your text is only one line):

    a=text.sourceText.value;

    if (textIndex > 1 && a[textIndex-1] == "a") {

    b=a[textIndex-2]; //check letter before the A

    (b=="a" || b=="e" || b=="k" || b=="l" || b=="q" || b=="x" || b=="z") ? 100 : 0;

    }

    else 0

  • It’s hard to tell exactly what you’re after here, but it can get pretty complicated if you need the wiggle to start where the last rotation ended and vice versa. Play with this and see what you think:

    bamm= thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    rotateRate = 150;

    threshold = 60;

    f = timeToFrames(time);

    rotateFrames = 0;

    wiggleFrames = 0;

    for (i = 0; i <=f; i++){

    bamm.valueAtTime(framesToTime(i)) > threshold ? rotateFrames++ : wiggleFrames++;

    }

    tW = framesToTime(wiggleFrames);

    tR = framesToTime(rotateFrames);

    w = wiggle(7,50,1,.5,tW) - valueAtTime(tW);

    tR*rotateRate + w

  • Dan Ebberts

    April 23, 2021 at 6:31 pm in reply to: Find the postition of the End Point of a Trim Path

    Actually, if you’re applying it to a point control, you’d want to change the last line to this:

    fromComp(L.toComp(p.pointOnPath(offsetPct,time)))
  • Dan Ebberts

    April 23, 2021 at 6:16 pm in reply to: Problem Scale expression… what i’m wrong?

    This should work:

    sc = thisComp.layer("SCALA_SECONDA_PARTE").transform.scale;

    sc[0] > 100 ? sc - [15,15] : sc

Page 116 of 1081

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