Forum Replies Created

Page 35 of 65
  • Andrei Popa

    March 23, 2020 at 4:14 pm in reply to: if/else in an array

    Hi Craig.
    If you have AE 2019+, you can use the includes() function:

    h = thisComp.layer("CONTROLLER").effect("Home")("Slider");
    a = thisComp.layer("CONTROLLER").effect("Away")("Slider");
    i = [1, 6, 11, 12, 16, 17, 20, 21, 22, 23, 25, 26, 27, 28, 30, 32];
    i.includes(h) || i.includes(a) ? 100 : 0

    Older AE don’t have includes() defined so you have to make a similar function:

    function arrayIncludes(arr,el){
    for(var i=0; i

    Andrei
    My Envato portfolio.

  • Check if this works. I tested it with simple on, off,on,off keyframes and worked

    fadeTime = 0.5;
    cb = thisComp.layer("Controller").effect("Timer ON")("Checkbox");

    if (cb.numKeys > 0) {
    n = cb.nearestKey(time).index;
    t = cb.key(n).value == 1 ? time - cb.key(n).time : cb.key(n).time - time;
    ease(t, 0, fadeTime, 0, 100);
    } else cb.value > 0 ? 100 : 0;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 22, 2020 at 9:04 am in reply to: Position text only inside area

    Har way, but looks better:
    You can save data for the layer(width, top, bot, left, right). First, check if the layer has one of the 4 corners out. Then check if its smaller than a screen(as width). If it is, move it horizontally to fit inside the screen. If it’s larger, move it vertically until it reaches the point where it can be displayed on 2 screens.

    Easy way:
    Put the text only in the space with all the screens(red area).

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 22, 2020 at 8:35 am in reply to: cycling layers

    What I suggest you do is make a csv, tsv or json file and use it to populate your text fields. You can easily make csv and tsv with google sheets.

    This post shows you how to use them inside after effects.
    https://helpx.adobe.com/after-effects/using/data-driven-animations.html

    You can put the day in column 1 and the text for that day in column 2.
    If you have multiple text layers for each day, you can even use more columns.

    Then, with a slider inside after effects you select the day.
    And with some expression inside each text layer you can get the before and after day text(by replacing myDay with myDay-1 or myDay-2). They should look similar to this:

    myDay = thisComp.layer("Controls").effect("Slider Control")("Slider")
    footage("myTable.csv").dataValue([myDay,1])

    With this setup, all you have to do is open After Effects, change slider and render.
    And you have all past days and unlimited future days saved inside a file.

    If you wish me to help you with the setup, you can contact me and we can work something out.

    Andrei
    My Envato portfolio.

  • I just want to understand better what you are after. Why do you need easing before and after keyframe? Wouldn’t it be enough to ease after the keyframe like this: after checkbox off, ease to zero. After checkbox on, ease to one. That way, you can get both in and out animations. You must be careful not to put consequent keyframes with the same value. When this expression finds a “ON” keyframes, goes from 0 to 100 even if the value was 100 before the keyframe.

    If that suits your case, this could be the expression:

    fadeTime = 0.5;
    cb = thisComp.layer("Controller").effect("Timer ON")("Checkbox");

    if (cb.numKeys > 0) {

    n = cb.nearestKey(time).index;
    if (cb.key(n).time > time) n--;

    if (n > 0) {

    t = time - cb.key(n).time;
    if (cb.key(n).value > 0) ease(t, 0, fadeTime, 0, 100);
    else ease(t, 0, fadeTime, 100, 0);

    } else {
    cb.key(1).value == 1 ? 0 : 100;
    }

    } else cb.value > 0 ? 100 : 0;

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2020 at 12:53 pm in reply to: change fonts with expressions

    I am sorry for the ambiguity of my answer. Yes, you can’t do it with expressions. You can change the font of a layer, but for the whole text.

    The only work-around for your case(that i can think of) would be to split the text in 2 layers and put some distance between them. That way, you can have 2 different styles.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 21, 2020 at 7:27 am in reply to: change fonts with expressions

    YOU CAN’T!

    But if you are so sure you can, why don’t you do it yourself?

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 20, 2020 at 7:13 pm in reply to: change fonts with expressions

    Last time I checked, you could not set different font types for the same layer. I don’t think they changed that in the latest updates.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    March 20, 2020 at 9:10 am in reply to: Checking for carriage returns in a text layer

    How did you search for a certain word?

    Try this:

    thisLayer.text.split("\r").length-1

    Andrei
    My Envato portfolio.

  • Andrei Popa

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

    Close!

    But this is the expression you need.

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

    Every expression in After Effects calculates time in number, not frames. The 15th frame in a 30 fps composition is a 0.5 time. For example framesToTime(15) turns the number 15 into a 0.5 in a 30 fps composition. That is exactly the kind of transformation you need.

    Andrei
    My Envato portfolio.

Page 35 of 65

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