Forum Replies Created

Page 50 of 65
  • multiplier = 20;
    columnNumber = 5;
    xpos = (index-1)%columnNumber*multiplier;
    ypos = Math.ceil(index/columnNumber)*multiplier;
    [xpos,ypos]

    If you want different multiplier on columns/rows:

    columnMultiplier = 20;
    rowMultiplier = 25;
    columnNumber = 5;
    xpos = (index-1)%columnNumber*rowMultiplier;
    ypos = Math.ceil(index/columnNumber)*columnMultiplier ;
    [xpos,ypos]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 24, 2019 at 8:40 am in reply to: Animation triggered by markers (once again…)

    I also messed up the “r” thing.

    txt = thisComp.layer("notas").text.sourceText.split("\r");
    nota = thisLayer.name;

    m = thisComp.marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if ((n > 0) && (txt[m.key(n).index-1] == nota)){
    100;
    }else
    0

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 24, 2019 at 8:38 am in reply to: Animation triggered by markers (once again…)

    That split in line one should have “\r” as parameter, not “r”. I think you missed something when copying the expression, because that should break it.

    And your behaviour is due to the handeling of the array “txt”. Subtract 1 from marker instead of adding. You are starting from row 3.

    txt = thisComp.layer("notas").text.sourceText.split("r");
    nota = thisLayer.name;

    m = thisComp.marker;
    n = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }
    if ((n > 0) && (txt[m.key(n).index-1] == nota)){
    100;
    }else
    0

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 20, 2019 at 8:39 pm in reply to: Reference Bottom Layer

    I am not 100% sure if thisComp.numLayers works with expressions and can’t test it right now, but my guess would be:
    thisComp.layer(thisComp.numLayers)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 14, 2019 at 9:43 am in reply to: Is there still a viable way to write AE scripts ?

    Visual studio code has a debugger. But its not as good as the extendscript one in my opinion.

    What i do is write the code in atom, and when i finish the script, i open it in extendscript for tests.

    Atom is just great. You can run the scripts from it, has autocomplete, better find/replace. Way better colors, runs well with git, has support for multiple kanguages. And the plus is that you can run extendscript in parallel. With visual studio code debugger you can’t.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 13, 2019 at 1:41 pm in reply to: Is there still a viable way to write AE scripts ?

    I can suggest you 2 ways.

    1. Install Visual Studio Code and the ESTK debugger.
    Visual Studio Code
    ESTK debugger news and information

    2.Install Atom and use Extendscript only for debugging purposes(This is what I use).
    Atom needs this

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 13, 2019 at 1:33 pm in reply to: Insert Line Break every X number of characters

    Apply this to the Anchor point

    var left = sourceRectAtTime(time,false).left;
    var top = sourceRectAtTime(time,false).top;
    var myWidth = sourceRectAtTime(time,false).width;
    var myHeight = sourceRectAtTime(time,false).height;
    var x = left + myWidth/2;
    var y = top + myHeight/2;
    [x,y]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 13, 2019 at 6:53 am in reply to: Scaling text to text box expression

    Hey Kalle. This is a pretty impressive expression. Congrats on that. But i have one question that I would like to ask. How did you get to the char_per_line calculation? I thought my math was decent, but i just can’t understand where that came from.

    Andrei
    My Envato portfolio.

  • You could make it that way too, but it is slower. And it grows in complexity very fast if you have multiple layers. That is because expressions don’t have memory. So the last circle will send you to the 3rd, calculate its expression which then sends you to the 2nd, calculate that etc.

    With all of them linked to a single slider, each expression calculates only once. So i guess the best way is to calculate the difference and repeatedly apply it to your layers.

    For example, instead of “25, 50, 75” write “25 * index” if your layers start at one. Or substract the necesarry amount if they don’t start at one (ex: “25*(index -x)”

    Andrei
    My Envato portfolio.

  • Andrei Popa

    May 8, 2019 at 3:12 pm in reply to: value error

    *kneels broken ,tear in his eyes* Nooooooooooo!!!

    Andrei
    My Envato portfolio.

Page 50 of 65

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