Forum Replies Created

Page 13 of 65
  • This should also work for multiline texts. I use a line instead of a rectangle, I hope this is not an issue.

    1. Create a text.

    2. Create a second text with an animator that only shows your word. Make this invisible. Set the previous text as parent. Set anchorpoint to [0,0] if necessary and position to [0,0].

    3. Create a shape layer. Parent it to the first layer, set anchor point and position to [0,0]. Add a path to this shape layer, and add this expression to the Path property (to modify how low is the line compared to the word, modify diff value):

    L = thisComp.layer(index-1);

    R = L.sourceRectAtTime(0,false);

    myLeft = R.left;

    myWidth = R.width;

    myTop = R.top;

    myHeight = R.height;

    diff = 5;

    p1 = [myLeft, myTop+myHeight+diff];

    p2 = [myLeft+myWidth, myTop+myHeight+diff];

    createPath(points = [p1,p2], inTangents = [], outTangents = [], isClosed = false)

    Here is a project that has all this already built in. The second text takes the text, font, font size and leading from the previous so you don’t have to worry about changing both. To change the underlined wort, change the slider on the main text. The only thing you need to pay attention to is not put any layer between these, because there is an expression using (index-1)

  • Andrei Popa

    October 2, 2021 at 6:09 am in reply to: Scripting help

    The problem here is that you are moving items in your project while looping through them. You need first to save them into an array then loop through that array. Try this:

    movepsd.onClick = function () {

    var psdFolder = null;

    for (var i = 1; i <= app.project.numItems; i++) {

    if (

    app.project.item(i) instanceof FolderItem &&

    app.project.item(i).name == "psd"

    ) {

    psdFolder = app.project.item(i);

    break;

    }

    }

    if (psdFolder == null) return;

    var projItems = [];

    for (var i = 1; i <= app.project.numItems; i++) {

    projItems.push(app.project.item(i));

    }

    for (var i = 0; i < projItems.length; i++) {

    var splitName = projItems[i].name.split(".");

    if (

    (projItems[i] instanceof FootageItem &&

    splitName[splitName.length - 1].toLowerCase() == "psd") ||

    splitName[splitName.length - 1].toLowerCase() == "PSD"

    )

    projItems[i].parentFolder = psdFolder;

    }

    };

  • Here is an .aep with what you may want. But looks like the data in your array is a little wrong. You may modify the array in the first row for different time/number of words.

  • I am not 100% sure how you want this to work. Do you want only that word to be visible? For example, would “Mary” only be visible between 6 milliseconds and 297 milliseconds and then disappear? And then “had” would appear at 461 milliseconds and disappear at 507 milliseconds?

  • Andrei Popa

    September 23, 2021 at 5:55 am in reply to: Combining setFont with variable sourceText

    It is not possible to set different fonts in a single layer via expressions.

    If the only difference between the fonts is italic/bold/regular, you can try to mimic the look by using a text animator and setting different skew/stroke width for a part of the text.

  • Andrei Popa

    September 22, 2021 at 6:48 pm in reply to: Pause video layer until triggered by slider

    How is it triggered by the slider?

    If, say you want to start playing at the second 56, set the slider to 56 and add this expression to the time remap:

    sldr = effect("Slider Control")("Slider").value;
    time-sldr
  • Andrei Popa

    September 21, 2021 at 12:36 pm in reply to: copy markers from layer markers to comp markers

    Here is a script made by Jeff Almasol, that could be downloaded from his website, redefinery.com, when it was not offline.

    https://www.dropbox.com/s/2adn48jkkpaqyus/rd_CopyMarkers.jsx?dl=0

  • Andrei Popa

    September 21, 2021 at 10:24 am in reply to: Sourcetext ignore ( or create ) line breaks

    If you want to put the line break via slider, you could use this:

    var s = text.sourceText;
    var f = " ";
    var r = "\r";
    var n = effect("Slider Control")("Slider").value;
    const replace_nth = function (s, f, r, n) {
    // From the given string s, replace f with r of nth occurrence
    return s.replace(RegExp("^(?:.*?" + f + "){" + n + "}"), x => x.replace(RegExp(f + "$"), r));
    };
    replace_nth(s,f,r,n);
  • Try something like this. dur is duration in frames, charNo is how many characters you want at a time.

    charNo = 9;
    dur = 3;
    totalChars = text.sourceText.length;
    txt = text.sourceText;
    st = Math.floor(timeToFrames(time)/dur)%totalChars;
    t1 = txt.substr(st,Math.min(charNo, totalChars-st));
    t2 = txt.substr(0,Math.max(0, st+charNo - totalChars));
    t1+t2
  • Oh, you meant vertically? I am sorry, I missunderstood the issue. You need to replace the

    w.top/2

    with

    w.top+w.height/2

    This means that you start fromt he top point, then add half the height of the rectangle.

Page 13 of 65

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