Forum Replies Created

Page 36 of 65
  • Andrei Popa

    March 17, 2020 at 6:25 pm in reply to: Random expression with exceptions

    Do you have After Effects 2019 or later? If yes, go to Project Settings>Expressions and set the Expression Engine to Javascript.

    If you do not wish to change your Expression Engine to Javascript(I suggest you do), you can use this expression:


    function include(arr, obj) {
    for (var i = 0; i < arr.length; i++) {
    if (arr[i] == obj) return true;
    }
    }

    exceptions = [2,4,6];
    randomSeed=time*thisComp.frameDuration;
    result=Math.round(random(10));
    while(include(exceptions,result)){
    randomSeed+=Math.round(random(100));
    result=Math.round(random(10));
    }
    result

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 17, 2020 at 6:17 pm in reply to: Change Color In layer order every 5 frames

    This should work.
    Replace the hex numbers between quotes with the hex number of your colors.

    linear(time,index*5,index*5+10,hexToRgb("FF0000"),hexToRgb("000000"))

    Andrei
    My Envato portfolio.

  • I think is something like this:

    style.setFontSize(100).setText("My text");

    For more information check https://helpx.adobe.com/after-effects/using/expressions-text-properties.html

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 16, 2020 at 9:21 am in reply to: Random expression with exceptions

    I think this will work

    exceptions = [2,4,6];
    randomSeed=time*thisComp.frameDuration;
    result=Math.round(Math.random(10));
    while(exceptions.indexOf(result)!=-1){
    randomSeed+=Math.round(Math.random(100));
    result=Math.round(Math.random(10));
    }
    result

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 11, 2020 at 10:46 am in reply to: Expression to display remaining time in timecode

    I forgot to subtract the over-60 values in the end. This should be the correct way:
    function rawToTimecode(number){
    var seconds = Math.floor(number);
    var minutes = Math.floor(seconds / 60);
    var hours = Math.floor(minutes / 60);
    var frames = Math.round((number-seconds)/thisComp.frameDuration);
    return [hours,minutes%60,seconds%60,frames]
    .map(
    function(n){
    return(n>10) ? n : "0"+n
    }
    ).join(":");
    }
    var rawTime = thisComp.duration-time;
    rawToTimecode(rawTime)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 11, 2020 at 9:03 am in reply to: Expression to display remaining time in timecode

    This works. You can also remove some values if you would like to not see them.


    function rawToTimecode(number) {
    var seconds = Math.floor(number);
    var minutes = Math.floor(seconds / 60);
    var hours = Math.floor(minutes / 60);
    var frames = Math.round((number - seconds) / thisComp.frameDuration);
    return [hours, minutes, seconds, frames]
    .map(
    function (n) {
    return (n > 10) ? n : "0" + n
    }
    ).join(":");
    }
    var rawTime = thisComp.duration - time;
    rawToTimecode(rawTime)

    Andrei
    My Envato portfolio.

  • Not really sure what you want but this may be a solution; On the second layer add this as sourceText

    specificLetter = "L";
    stringToSearch = thisComp.layer("HELLO").text.sourceText;
    stringToSearch.split(specificLetter).length-1

    You can make this case-insensitive(ignore differenced between a and A) like this:

    specificLetter = "L";
    stringToSearch = thisComp.layer("HELLO").text.sourceText.toUpperCase();
    stringToSearch.split(specificLetter.toUpperCase()).length-1

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 10, 2020 at 8:35 am in reply to: Distribute evenly in a circle

    To make them orbit or change radius, you just have to centralize the data. I added a null as the last layer in that comp and 2 sliders to it: Radius and Rotiation. Modify these 2 in order to change the radius/make the objects orbit. Here are the new expressions added to anchor point and rotation of the layers.

    Anchor Point:

    var left = sourceRectAtTime(time,false).left;
    var myHeight = sourceRectAtTime(time,false).height;
    var myWidth = sourceRectAtTime(time,false).width;
    var top = sourceRectAtTime(time,false).top;
    [left+myWidth/2-thisComp.layer("Center").effect("Radius")("Slider"),myHeight/2+top]

    Rotation:
    360/(thisComp.numLayers-1)*index+thisComp.layer("Center").effect("Rotation")("Slider")

    Also, here is a link to my project in case you want to check it out. https://www.dropbox.com/s/n4dsozkm5imxein/Circle%20payers.aep?dl=0

    Andrei
    My Envato portfolio.

  • To get more of the matchNames, use rd_gimmePropPath on those properties, after you manually added them.

    Andrei
    My Envato portfolio.

  • Most of the properties:

    var anim = app.project.activeItem.layer(1).Text.Animators.addProperty("ADBE Text Animator");

    //add range selector
    anim("ADBE Text Selectors").addProperty("ADBE Text Selector");

    var animProperties = anim("ADBE Text Animator Properties");

    //Add properties

    //andchorPoint
    animProperties.addProperty("ADBE Text Anchor Point 3D");

    //position
    animProperties.addProperty("ADBE Text Position 3D");

    //scale
    animProperties.addProperty("ADBE Text Scale 3D");

    //skew
    animProperties.addProperty("ADBE Text Skew");

    //skew axis
    animProperties.addProperty("ADBE Text Skew Axis");

    //rotation
    animProperties.addProperty("ADBE Text Rotation");

    //Opacity
    animProperties.addProperty("ADBE Text Opacity");

    Andrei
    My Envato portfolio.

Page 36 of 65

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