Forum Replies Created

Page 27 of 1278
  • Ae updated its Javascript engine a few releases ago, and that came with stricter enforcement of curly braces around blocks in if/else statements.

    Here’s the code above, updated for recent releases of Ae:

    rate = -1;

    clockStart = 900;

    function padZero(n) {

    if (n < 10)

    return "0" + n;

    else {

    return "" + n;

    }

    }

    clockTime = Math.max(clockStart + rate * (time - inPoint), 0);

    t = Math.floor(clockTime);

    min = Math.floor((t % 3600) / 60);

    sec = Math.floor(t % 60);

    min + ":" + padZero(sec)

  • Walter Soyka

    August 25, 2021 at 3:41 pm in reply to: Counter script: space between numbers

    Add Math.round around linear, like this:

    startT = 1;

    endT = 5;

    beginVal = 100000;

    endVal = 1000037;

    t = Math.round(linear(time,startT,endT,beginVal,endVal));

    t += "";

    t.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");

  • In that code snippet, you never define myComp (should just be ‘comp’) or thisEffect (should reference something from ‘getEffects’) , so Ae doesn’t know what to do.

    This code should work — let me know if you have any questions!

    {

    var comp = app.project.activeItem;

    var getEffects;

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

    getEffects = comp.layer(i).Effects;

    for (var j = getEffects.numProperties; j > 0; j--) {

    if (getEffects.property(j).matchName == "Pseudo/matchName") {

    getEffects.property(j).remove();

    }

    }

    }

    }

  • Walter Soyka

    August 24, 2021 at 5:14 pm in reply to: What statement to check character in word ?

    I’m assuming that you want paF to be an array of face-related layers?

    This code loops through all selected layers.

    If it finds a HEAD layer, it sets paH to that layer. (Note that if you have multiple HEAD layers, no error will be thrown and the script will just use the last HEAD layer in the selection.)

    If it finds a FACE layer, it pushes that layer onto the paF array. paF begins as a null layer, and then each detected FACE layers is added to the array. Note that this array has its own indexing, not necessarily related to the comp’s index — though, of course, you can always look at paF[i].index to get that info.

    var layersList = app.project.activeItem.selectedLayers;

    var checkHAT = "HAT";

    var checkGAP = "GAP";

    var checkHAIR = "HAIR";

    var checkEAR = "EAR";

    var checkNOSE = "NOSE";

    var checkMOUTH = "MOUTH";

    var checkEYE = "EYE";

    var checkCHEEK = "CHEEK";

    var checkHEAD = "HEAD";

    var paH = 0;

    var paF = [];

    // iterate through all selected layers. Find the HEAD layer, and build an array of FACE-related layers.

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

    var child = layersList[i].name;

    /* check HEAD */

    if (child.indexOf(checkHEAD) > -1) {

    paH = layersList[i];

    }

    /* check FACE*/

    else if ((child.indexOf(checkHAIR) > -1) ||

    (child.indexOf(checkEAR) > -1) ||

    (child.indexOf(checkMOUTH) > -1) ||

    (child.indexOf(checkEYE) > -1) ||

    (child.indexOf(checkCHEEK) > -1) ||

    (child.indexOf(checkGAP) > -1) ||

    (child.indexOf(checkHAT) > -1)) {

    paF.push(layersList[i]);

    }

    } //loop out

    if (paH == 0) {

    alert("No " + checkHEAD);

    } else if (paH != 0) {

    var t = "Head layer:\n" + paH.name + "\n\nList of face layers (paF):\n";

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

    t += paF[i].name + "\n";

    }

    alert(t);

    }

  • Walter Soyka

    August 24, 2021 at 2:47 pm in reply to: Expressions and sine waves

    Once you’ve drawn the sine wave, you can animate the Offset effect to make it move.

  • You can use paragraph text to allow Ae to handle the line-wrapping for you. More details here:

    https://helpx.adobe.com/after-effects/using/creating-editing-text-layers.html

  • Walter Soyka

    August 23, 2021 at 5:46 pm in reply to: What statement to check character in word ?

    … and the comp it’s supposed to be working on.

  • Walter Soyka

    August 23, 2021 at 5:46 pm in reply to: What statement to check character in word ?

    It’s going to be very difficult for us to help debug logic errors in this code without being able to see more of it.

  • There are two problems in your code:

    1) The property name should be “Start”, not “Strat”.

    2) Multi-line strings need to be escaped with a backslash.

    This should work better:

    layers[i].Effects.addProperty("CC Bend It")("Start").expression = 'try{ \

    value+transform.position; \

    }catch(err){ \

    value;}';

  • Walter Soyka

    August 20, 2021 at 3:59 pm in reply to: Can i export m2v from Aftereffects?

    Not directly from the Render Queue — you’ll have to use Adobe Media Encoder to output .M2V.

Page 27 of 1278

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