Forum Replies Created

Page 49 of 65
  • Andrei Popa

    July 11, 2019 at 8:18 am in reply to: how to freeze frame by script?

    app.project.item(2).layer(2).timeRemapEnabled = true;
    app.project.item(2).layer(2).property("timeRemap").setInterpolationTypeAtKey(1,KeyframeInt erpolationType.HOLD)

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 11, 2019 at 8:14 am in reply to: Animating a table with expressions

    I see 2 ways there. Either create 30 arrays with the rank on each team per day(like tottenham = [12,11,14,etc]) or one with days and the teams(day1 = [“Manchester”,”Liverpool”]) etc. The days approach would be maybe nicer to read.

    So if we take the second approach you must create a json file that is similar to this:

    {

    "day1":[
    "Manchester",
    "Liverpool",
    "Chelsea"
    ],
    "day2":[
    "Liverpool",
    "Manchester",
    "Chelsea"
    ],
    "day3":[
    "Liverpool",
    "Manchester",
    "Tottenham"
    ],
    "day4":[
    "Liverpool",
    "Spurs",
    "Chelsea"
    ]
    }

    The easiest approach inside the after effects is to create 30 text layers(they must start from index 1) and write this to their textSource:

    eval("var standings =" + footage("delete this.json").sourceText);
    delay = 3;
    dayNumber = 4;
    x = "day"+(Math.floor(time/delay)+1);
    (time/delay<4) ? standings[x][index-1] : value;

    Delay is how often they change, dayNumber is the total number of days.

    If you want to animate the position of those teams, it’s a more sophisticated matter.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 10, 2019 at 10:32 am in reply to: Interpolating animation

    I think this may be what you need

    if (time>key(2).time){
    x = linear(position[0], key(2).value[0], key(3).value[0],key(2).value[0], thisComp.layer("Control Null")("Transform")("Position")[0]);
    y = linear(position[1], key(2).value[1], key(3).value[1],key(2).value[1], thisComp.layer("Control Null")("Transform")("Position")[1]);
    [x,y]
    }else{
    value
    }

    This works as long as you do not need to modify anything after the 3rd keyframe.
    You can also calculate the third position, instead of linking it to a layer.
    This also allows you to interpolate the animation as you want(it takes the easing from the keyframes, it just modifies the values).

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 4, 2019 at 8:21 am in reply to: Setting value of 2nd keyframe by null position

    This may work.
    p = thisComp.layer("Shape Layer 2").transform.position;
    v1 = key(1).value;
    v2 = key(2).value;
    linear(value[1],v1[1],v2[1],p,v1);

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 2, 2019 at 11:32 am in reply to: sourceRect text layers which play off each other.

    So you try to go for the largest layer, but not over 100?

    Layer1Width = thisComp.layer("LINE_01").sourceRectAtTime().width;
    Layer2Width = thisComp.layer("LINE_02").sourceRectAtTime().width;
    Layer3Width = thisComp.layer("LINE_03").sourceRectAtTime().width;

    LayerRatio = 100 * 1700 /Math.max( Layer1Width, Layer2Width, Layer3Width);
    (LayerRatio<100) ? [LayerRatio, LayerRatio] : [100,100];

    You can put however many layers you wish.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 1, 2019 at 9:39 pm in reply to: Add values to proximity based expression

    Not sure tour 3 text way is the best, but in a lack of solutions, here we go. I think this should work.

    len1 = length(position, thisComp.layer("Text1").position);
    len2= length(position, thisComp.layer("Text2").position);
    len3 = length(position, thisComp.layer("Text3").position);
    len4 = length(position, thisComp.layer("Text4").position);
    t = Math.min(len1, len2, len3, len4);
    s = ease(t, 200, 0, 0, 100);
    [s, s]

    Andrei
    My Envato portfolio.

  • Andrei Popa

    July 1, 2019 at 9:31 pm in reply to: Animate from zero to slider value

    linear(time,t1,t2,value1,value2)

    t1 – initial time
    t2 – final time
    value1 – initial value
    value2 – final value

    Instead of writing value2 you should pick-whip your slider.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 26, 2019 at 1:25 pm in reply to: Text layer PreComp

    Try this

    var myName = app.project.activeItem.selectedLayers[0];
    var size=app.project.activeItem.selectedLayers[0].sourceRectAtTime(app.project.activeItem.time,false);
    var myComp1 = app.project.items.addComp(myName.name,Math.round(size.width),Math.round(size.height),1,10,30);

    Andrei
    My Envato portfolio.

  • Why do you use the last alert? That is what give undefined. You have an alert inside the function that works ok. Then, when you try to allert the result of the function, it is undefined. To change that either remove the last alert, or return something with the function.

    Andrei
    My Envato portfolio.

  • Andrei Popa

    June 24, 2019 at 1:49 pm in reply to: Animation triggered by markers (once again…)

    [Andrei Popa] “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.”

    That was the difference in our code.

    Andrei
    My Envato portfolio.

Page 49 of 65

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