Forum Replies Created

Page 113 of 1081
  • You could try this (set startIndex to the index of the first (lowest numbered) layer participating):

    startIndex = 1;

    comp("Text Controller").layer("layer_" + (index-startIndex+1).toString().padStart(2,'0')).text.sourceText;

  • Dan Ebberts

    June 29, 2021 at 12:56 am in reply to: Scaling size restrictions including a failsafe for 0

    Something like this should work:

    maxW = thisComp.width*0.85;

    maxH = thisComp.height*0.075;

    r = sourceRectAtTime(time);

    w = r.width;

    h = r.height;

    if (w > 0 && h > 0){

    s = w/h > maxW/maxH ? maxW/w : maxH/h;

    }else{

    s = 1;

    }

    [100,100]*s;

  • Dan Ebberts

    June 24, 2021 at 6:13 pm in reply to: continue motion velocity

    Try changing the curly quotes to straight quotes:

    loopOut(“continue”,0)

  • This should work:

    delay = thisComp.layer("Control").effect("Delay 1")("Slider");

    Math.max(0,valueAtTime(time-delay));

  • Maybe turn on time remapping for the precomps and add a time remap expression like this:

    s = thisComp.layer("Control").effect("Delay 1")("Slider");

    delay = framesToTime(s);

    Math.max(0,valueAtTime(time-delay));

  • Dan Ebberts

    June 18, 2021 at 5:56 pm in reply to: 2D effect positions on 3D layer relative to camera

    I’m not sure exactly what you’re after, but I think what you have is the same as this:

    toComp(anchorPoint)

  • Dan Ebberts

    June 16, 2021 at 5:49 pm in reply to: AE If condition statement

    Maybe something like this. You just need to include all your special characters in the search:

    pos1 = value;

    pos2 = [100,100];

    myString = "žlutý kůň";

    myPos = pos1;

    if (myString.search(/š|č|ř|ž|ý|ů|ň/) > -1){

    myPos = pos2;

    }

    myPos

  • Dan Ebberts

    June 11, 2021 at 1:28 pm in reply to: Slider to change colors

    It might be as simple as this:

    c1 = effect("color control 01")("Color");

    c2 = effect("color control 02")("Color");

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

    linear(s,0,100,c1,c2)

  • The key to the whole thing is finding the time when the list starts moving in the direction that causes the header to be revealed. That code will probably look something like this, but not knowing how you have things set up, I’m not sure what you need to do with the resulting time value, t:

    y = thisComp.layer("Blue").transform.yPosition;

    t = 0;

    if (y.velocity >= 0){

    for (f = timeToFrames(time); f >= 0; f--){

    if (y.velocityAtTime(framesToTime(f)) >= 0) continue;

    t = time - framesToTime(f);

    break;

    }

    }

    t

  • Dan Ebberts

    June 7, 2021 at 9:46 pm in reply to: Triggering an animation using a Text Layer Value

    <div>It sounds like maybe you’re after something very different than what I posted. This is a version that should run your time remapped comp animation as long as the text is “On”, hold the last value when the text goes “Off”, and start again (not from zero, but from the held time) if it goes “On” again:</div>

    txt = thisComp.layer("Text").text.sourceText;

    n = 0;

    for (f = 0; f < timeToFrames(time); f++){

    if (txt.valueAtTime(framesToTime(f)) == "On"){

    n++;

    }

    }

    framesToTime(n);

    >I don’t know if it’s uncouth to post my own renamed and commented version of your script on here?

    Not an issue.

Page 113 of 1081

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