Forum Replies Created

Page 26 of 65
  • I think you may have an error when no markers are present. This should not throw any error, even if no markers are there

    dur = 12*thisComp.frameDuration;
    d1 = (thisComp.layer("TextBox 1").content("Rectangle 1").content("Rectangle Path 1").size[0]/2) ;
    d2 = (thisComp.layer("TextBox 2").position[0]) ;
    d3 = (thisComp.layer("TextBox 3").position[0]) ;
    d4 = (thisComp.layer("TextBox 4").position[0]) ;
    d5 = (thisComp.layer("TextBox 5").position[0]) ;
    d6 = (thisComp.layer("TextBox 6").position[0]) ;
    d7 = (thisComp.layer("TextBox 7").position[0]);
    d8 = (thisComp.layer("TextBox 8").position[0]);
    d9 = (thisComp.layer("TextBox 9").position[0]);
    d10 = (thisComp.layer("TextBox 10").position[0]);

    move1 = d1;
    move2 = d1 + d2;
    move3 = d1 + d3;
    move4 = d1 + d4;
    move5 = d1 + d5;
    move6 = d1 + d6;
    move7 = d1 + d7;
    move8 = d1 + d8;
    move9 = d1 + d9;
    move10 = d1 + d10;

    pos = [
    value - move1,
    value - move2,
    value - move3,
    value - move4,
    value - move5,
    value - move6,
    value - move7,
    value - move8,
    value - move9,
    value - move10,
    ];

    if (marker.numKeys > 0) {
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time) {
    n--;
    }
    }else{
    n=0;
    }
    if (n == 0 || n >= pos.length){
    pos[0];
    }else{
    t = marker.key(n).time;
    ease(time,t,t+dur,pos[n-1],pos[n])
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 25, 2020 at 5:07 pm in reply to: Change color per character of text

    You add the fill animator by clicking the “Animate” button that is right of your “Text” properties then “Fill Color” then “RGB”.
    Anyway, here is a link to a project that contains such a text layer https://www.dropbox.com/t/2oMNyIjbcQ6O0wfk

    Andrei
    My Envato portfolio.

  • Try this.
    Change the 12 from the first row to how many frames you want the animation to take.
    It should move to the next text with each marker.


    dur = 12*thisComp.frameDuration;
    d1 = (thisComp.layer("TextBox 1").content("Rectangle 1").content("Rectangle Path 1").size[0]/2) ;
    d2 = (thisComp.layer("TextBox 2").position[0]) ;
    d3 = (thisComp.layer("TextBox 3").position[0]) ;
    d4 = (thisComp.layer("TextBox 4").position[0]) ;
    d5 = (thisComp.layer("TextBox 5").position[0]) ;
    d6 = (thisComp.layer("TextBox 6").position[0]) ;
    d7 = (thisComp.layer("TextBox 7").position[0]);
    d8 = (thisComp.layer("TextBox 8").position[0]);
    d9 = (thisComp.layer("TextBox 9").position[0]);
    d10 = (thisComp.layer("TextBox 10").position[0]);

    move1 = d1;
    move2 = d1 + d2;
    move3 = d1 + d3;
    move4 = d1 + d4;
    move5 = d1 + d5;
    move6 = d1 + d6;
    move7 = d1 + d7;
    move8 = d1 + d8;
    move9 = d1 + d9;
    move10 = d1 + d10;

    pos = [
    value - move1,
    value - move2,
    value - move3,
    value - move4,
    value - move5,
    value - move6,
    value - move7,
    value - move8,
    value - move9,
    value - move10,
    ];

    if (marker.numKeys > 0) {
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time) {
    n--;
    }
    }
    if (n == 0 || n >= pos.length){
    pos[0];
    }else{
    t = marker.key(n).time;
    ease(time,t,t+dur,pos[n-1],pos[n])
    }

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 25, 2020 at 7:37 am in reply to: Change color per character of text

    Since you need 4 colors, you need 4 text animators. And you need 4 color controls effects on the layer so you can change colors easily. So here’s how we’re gonna do that:

    Step 1. Add 4 color controls to your text layer. I named them “Color 1”, “Color 2” etc.

    Step 2. Add a “Fill” text animator. Pick-whip the color to Color 1. The expression should be this:
    effect("Color 1")("Color")
    Then add an expression selector to your animator. Choose “Based on” ->”Characters Excluding Spaces”
    Add this expression to the “Amount”:
    if ( textIndex%4 == 1 ) 100
    else 0

    Step 3. Duplicate this animator to make 4 of them. The expressions to the other 3 will be almost the same:

    2
    effect("Color 2")("Color")
    if ( textIndex%4 == 2 ) 100
    else 0

    3
    effect("Color 3")("Color")
    if ( textIndex%4 == 3 ) 100
    else 0

    4
    effect("Color 4")("Color")
    if ( textIndex%4 == 0 ) 100
    else 0

    Now you can change all the colors from the 4 color controls you placed at the beginning

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 1, 2020 at 4:59 pm in reply to: Automatic font size on text based on its width

    Something like

    style.setFauxBold(1).setFauxItalic(1).setFontSize(900).setText(thisComp.layer(“Main”).text.sourceText.value)

    Andrei
    My Envato portfolio.

  • You could use this as an expression on text source for the repeat and a linear wipe if you need the wipe effect. This expression allows you to add spaces at the end of the text so the repeats are not close. Replace the number in parenthesis with the number of repeats you need.


    text.sourceText.repeat(3)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 1, 2020 at 11:12 am in reply to: Automatic font size on text based on its width

    Is there a particular reason why you don’t decrease the size? If you want to decrease the scale, you can use this as an expression, applied to scale:


    maxWidth = 500;
    thisWidth = sourceRectAtTime(time,false).width;
    ratio = Math.min(maxWidth/thisWidth,1);
    value*ratio

    Andrei
    My Envato portfolio.

  • It’s called modulo operator. It is what left when you divide it by that number.

    Eg: if you divide 5 by 2, it is 2 and 1 left. So 5%2 is 1.
    You use this operator when want to create a cycle. time%10 would start from zero to 10. Then the second it hits 10, starts from zero again. Because 10%10 is 0. And again at 20 and so on.

    Andrei
    My Envato portfolio.

  • Try this:

    x = value[0];
    L = thisLayer;
    y = L.sourceRectAtTime(time-L.inPoint).height%32000;

    [x,-y*5];

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 24, 2020 at 9:23 am in reply to: sourceRectAtTime& Text Tracking

    Forgot to subtract the 1 from the letter number.


    actualWidth = sourceRectAtTime(-1, false).width;
    desiredWidh = 250;
    diff = desiredWidh - actualWidth;
    numLetters = text.sourceText.value.split("").length-1;
    diff > 0 ? linear(time, 0 - thisComp.frameDuration, 0, 0, diff / numLetters) : 0;

    Andrei
    My Envato portfolio.

Page 26 of 65

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