Forum Replies Created

Page 7 of 65
  • Andrei Popa

    July 26, 2022 at 10:56 am in reply to: Join seperate mask paths together via ExtendScript

    Did not test this function, but it should work. Save the values of your paths in an array and then use the function. It should return a path object that is the result of concatenating all the paths in the array, in order.

    function pastePathForArray(arrayOfPaths) {
    var finalPath = new Shape();
    for (var i = 0; i < arrayOfPaths.length; i++) {
    finalPath = pastePath(finalPath, arrayOfPaths[i]);
    }
    return finalPath;
    function pastePath(path1Value, path2Value) {
    var bothPaths = new Shape;
    bothPaths.vertices = path1Value.vertices.concat(path2Value.vertices);
    bothPaths.inTangents = path1Value.inTangents.concat(path2Value.inTangents);
    bothPaths.outTangents = path1Value.outTangents.concat(path2Value.outTangents);
    return bothPaths;
    }
    }

  • Andrei Popa

    July 14, 2022 at 4:42 pm in reply to: Delay position animator per row

    This was exactly what I was looking for.

    Thanks Filip

  • Andrei Popa

    July 7, 2022 at 6:03 pm in reply to: Text string problems

    For the highlight you need to add a fill color text animator. After you have added that, go to the animator, click Add>Selector>Expression. And write the 2 expressions that I have provided.

    Here is a project that contains a text layer with 2 animators, named Red and Green, that do this highlight.

    Edit: I don’t know why adding files doesn’t work. Here is a dropbox link for the file.

    https://www.dropbox.com/s/32doaas4d9jfghd/Highlight.aep?dl=0

  • Andrei Popa

    July 7, 2022 at 1:34 pm in reply to: Text string problems

    Maybe AE reads it as number. Try it like this instead:

    A3 = A3.toString().indexOf("-") != -1 ? A3 : "+" + A3;

    Same for B.

    If this does not work either, then it may be a different sign for minus. Try to copy paste the character from the text layer.

  • Andrei Popa

    July 7, 2022 at 10:41 am in reply to: Text string problems

    Hi Nick.

    Have you tried this though?

    A3 = A3[0] == “-” ? A3 : “+” + A3;

    This adds a + sign if there is not already a -. So if the text is -1, it remains -1. If it is 1, it becomes +1.

    So the whole expression of your text should be:

    A1 = footage("DAX Values 2 - General Usage.csv").dataValue([0,0]);

    A2 = footage("DAX Values 2 - General Usage.csv").dataValue([1,0]);

    A3 = footage("DAX Values 2 - General Usage.csv").dataValue([2,0]);

    B1 = footage("DAX Values 2 - General Usage.csv").dataValue([0,1]);

    B2 = footage("DAX Values 2 - General Usage.csv").dataValue([1,1]);

    B3 = footage("DAX Values 2 - General Usage.csv").dataValue([2,1]);

    A3 = A3[0] == "-" ? A3 : "+" + A3;

    B3 = B3[0] == "-" ? B3 : "+" + B3;

    string = A1 + " " + A2 + "E " + A3 + "%"+", "+ B1 + " " + B2 + "E " + B3 + "%";

    The other 2 things are expressions. They calculate the index of the text to be highlighted every frame. So every time you change the text, the index of the price will be calculated again.

    I don’t really know which part of these will not work.

  • Andrei Popa

    July 7, 2022 at 9:42 am in reply to: Text string problems

    To add the “+” sign I think you should add this at the end of the declaration block:

    A3 = A3[0] == “-” ? A3 : “+” + A3;

    B3 = B3[0] == “-” ? B3 : “+” + B3;

    To highlight the texts, you need to add 2 text animators. One with green fill and one with red fill. Add an expression selector to each. I think you need to use some regular expressions to determine which one to be highlighted. I am not really good with regex stuff, but I think that you should decide what is the first and the last char of the highlighted part, and use those to determine the string. Then use indexOf to see from where you start the highlight. Something like this maybe, for red (similar for green, but with + instead of -):

    red

    txt = text.sourceText.replace(/\r/g, "");
    highlightText = txt.match(/-.*? /);
    if (highlightText == null) 0;
    else {
    st = txt.indexOf(highlightText[0]);
    en = st + highlightText[0].length;
    if (st < textIndex && textIndex < en) 100;
    else 0;
    }

    green

    txt = text.sourceText.replace(/\r/g, "");
    highlightText = txt.match(/\+.*? /);
    if (highlightText == null) 0;
    else {
    st = txt.indexOf(highlightText[0]);
    en = st + highlightText[0].length;
    if (st < textIndex && textIndex < en) 100;
    else 0;
    }
  • Maybe try to make it self invoking, like this

    (function myScript(thisObj) {

    function myScript_buildUI(thisObj) {

    var myPanel = thisObj instanceof Panel ? thisObj : new Window("palette", "MyScriptName", undefined, { resizeable: true, closeButton: true });

    // Here goes the main function of the script //

    myPanel.layout.layout(true);

    return myPanel;

    }

    var myScriptPal = myScript_buildUI(thisObj);

    if (myScriptPal != null && myScriptPal instanceof Window) {

    myScriptPal.center();

    myScriptPal.show();

    }

    })(this);

    I am not sure this will work. However, I have some advice for you. Use this webpage to make the UI. It’s by far the best and easiest way to create UI for After Effects

    ScriptUI Dialog Builder (joonas.me)

  • You can use the name of the effect instead of its matchname if you want to. Like this:

    var durationIn = myLayers[i].Effects("IN")

    ? myLayers[i].Effects("IN")

    : myLayers[i].Effects.addProperty("ADBE Slider Control");

    durationIn.name = "IN";

    var durationOut = myLayers[i].Effects("OUT")

    ? myLayers[i].Effects("OUT")

    : myLayers[i].Effects.addProperty("ADBE Slider Control");

    durationOut.name = "OUT";

  • Andrei Popa

    May 28, 2022 at 4:22 am in reply to: Source Text work around for text

    I don’t think it is possible to replicate the text along with all the style things. When I need this kind of things (superscripts, different tracking/color) I use an animator with some expressions. But that requires clear information about which letters to be modified, and in your case that would be very difficult, if not impossible (I don’t know of a way to check if a character is superscript).

  • Andrei Popa

    May 28, 2022 at 4:15 am in reply to: sampleImage() and subtraction

    If the “property or method named ‘-1’ in Class ‘Array’ is missing…” is the error that bugs you, I think you could change x = total – 1; to x = total < 1 ? 0 : total – 1; basically telling AE that x is zero if total is smaller than 1.

Page 7 of 65

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