Forum Replies Created

Page 2 of 65
  • Andrei Popa

    September 21, 2024 at 11:34 am in reply to: marker name in the expression

    Hi Andy,

    I can help as much as time allows me. My personal email is andreipopa191187@gmail.com, you can write me there and we can talk.

    Cheers,

    Andrei

  • Andrei Popa

    September 19, 2024 at 12:56 pm in reply to: Text color without ponctuation

    Sorry for the oversight. We can fix that by subtracting 1 from each value in the index of words (which I did in the .map() function towards the end of the expression), since arrays start at zero, and our word counting at one.
    Here is the updated code.

    function getCharIndicesFromWordIndices(str, wordIndices) {
    var words = str.split(/\s+/);
    var charIndices = [];
    var currentCharIndex = 0;
    var punctuation = ",.!?;:'";
    for (var i = 0; i < words.length; i++) {
    if (wordIndices.indexOf(i) !== -1) {
    for (var j = 0; j < words[i].length; j++) {
    if (punctuation.indexOf(words[i][j]) == -1) charIndices.push(currentCharIndex + j);
    }
    }
    currentCharIndex += words[i].length + 1; // +1 for the space
    }
    return charIndices;
    }
    wordIndices = thisComp.layer("hilite").text.sourceText.split("+");
    var x = getCharIndicesFromWordIndices(text.sourceText, wordIndices.map(x => parseInt(x) - 1));
    x.indexOf(textIndex - 1) != -1 ? 100 : 0;

    In short, we used the “getCharIndicesFromWordIndices” function to get the index of each character present in your words, except punctuation. So instead of highlighting the word entirely, we highlight each character that is a part of that word.

  • Andrei Popa

    September 19, 2024 at 7:55 am in reply to: Text color without ponctuation

    I cant think of a different way but to count the characters instead of words.

    So if you want to use this solution, you need to change the “Based on” from “words” to “characters” and use this expression instead.

    You can add/remove characters you don’t want to be highlighted in the “punctuation” variable;

    function getCharIndicesFromWordIndices(str, wordIndices) {
    var words = str.split(/\s+/);
    var charIndices = [];
    var currentCharIndex = 0;
    var punctuation = ",.!?;:'";
    for (var i = 0; i < words.length; i++) {
    if (wordIndices.indexOf(i) !== -1) {
    for (var j = 0; j < words[i].length; j++) {
    if (punctuation.indexOf(words[i][j]) == -1) charIndices.push(currentCharIndex + j);
    }
    }
    currentCharIndex += words[i].length + 1; // +1 for the space
    }
    return charIndices;
    }
    wordIndices = thisComp.layer("hilite").text.sourceText.split("+");
    var x = getCharIndicesFromWordIndices(text.sourceText, wordIndices.map(x => parseInt(x)));
    x.indexOf(textIndex - 1) != -1 ? 100 : 0;
  • Andrei Popa

    September 9, 2024 at 12:48 pm in reply to: AE recursive check through layers

    This should work(if no “column” layer is found, it will return 0):

    idx = index;

    layerIdx = 0;

    while (idx >=1 && layerIdx == 0){

    if(thisComp.layer(idx).name == "column") layerIdx = idx;

    idx--;

    }

    layerIdx

  • Andrei Popa

    May 22, 2024 at 9:43 am in reply to: Responsive Mask Not Cooperating. Help Needed.

    Hi Brayden.

    In case you did not solve this yet, try to change your second line to

    var {height, width, left, top} = sourceRectAtTime(sourceTime(markerTime));

    You have probably moved your layer and the sourceRectAtTime function calculates the time based on your layer time, not the composition time.

  • You need to add parameters to the function like this:

    textWidth=thisComp.layer(“Saturday Night Live host, Timothée Chalamet, rode away with the show on his beloved tiny horse”).sourceRectAtTime(time, false).width;

    Also, sourceRectAtTime does not count for scale, so your final expression may look like this

    textWidth=thisComp.layer(“Saturday Night Live host, Timothée Chalamet, rode away with the show on his beloved tiny horse”).sourceRectAtTime(time, false).width * scale[0] * 0.01;

    textHeight=thisComp.layer(“Saturday Night Live host, Timothée Chalamet, rode away with the show on his beloved tiny horse”).sourceRectAtTime(<i style=”font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>time, false<i style=”background-color: var(–bb-content-background-color); font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>).height <i style=”font-family: inherit; font-size: inherit; color: var(–bb-body-text-color);”>* scale[1] * 0.01<i style=”font-family: inherit; font-size: inherit; color: var(–bb-body-text-color); background-color: var(–bb-content-background-color);”>;

    [490.2, textHeight]

  • Andrei Popa

    January 27, 2024 at 5:48 pm in reply to: Create a particular text animator.

    I managed to pull this off.

    I did 4 animators, for each direction. one positive value, one negative etc.

    I have set the shape to all to Ramp Down and I have put keyframes on Offset from -100 to +100. Each Offset -100 keyframe was positioned on the +100 keyframe from the previous one.

  • Andrei Popa

    December 22, 2023 at 5:30 pm in reply to: Layer names from csv

    The error is actually a typo I did in the for loop. So the script runs until it finds an error 😀

    The for condition should be this one

    for (var i = 1; i <= comp.numLayers; i++)

    The line 4 gets the composition object corresponding to the composition that is opened in the timeline. We use that in the for, to loop through all its layers.

    If you want to only apply this to selected layers, you should replace the for loop (the 3 rows) with this part:

    var selLayers = comp.selectedLayers;
    for (var i = 0; 1 < selLayers.length; i++) {
    selLayers[i].name = arr[i+1][columnIndex];
    }

    Haven’t tested this, but it should work.

  • Andrei Popa

    December 20, 2023 at 10:54 am in reply to: Layer names from csv

    Hi.

    This should be the logic of your script:

    var myFile = File.openDialog("Choose CSV file..");
    var arr = csvToArray(myFile);
    var columnIndex = 2;
    var comp = app.project.activItem;
    for (var i = 1; 1 <= comp.numLayers; i++) {
    comp.layer(i).name = arr[i][columnIndex];
    }

    For this to work, you also need the csvToArray function which parses the CSV. You can find it here:

    csvToArray – Pastebin.com

    Just paste the code from pastebin under the one from this page.

    You may need to change columnIndex to 1.

  • Andrei Popa

    November 4, 2023 at 8:12 am in reply to: Where to store metadata for layers?

    Thank you for the answer Dan.

    This seems like the optimal solution. If people get to see the comment, they may also be proficient enough in AE to know the should probably not change it.

Page 2 of 65

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