Forum Replies Created

Page 7 of 11
  • Robert Müller

    August 10, 2020 at 8:41 am in reply to: CSV file and counting Expression breaking

    Hi, how are you animating the bars, are they just simple rectangle shape paths?
    Your best option would be to go with the linear expression, like this
    v=footage("data.csv").dataValue([0,0]);
    s=thisComp.layer("shape 1").content("bar").content("bar").size[0];
    linear(s,0,1000,0,v)+"%"

    While the width of the bar reaches the value 1000, linear interpolates the corresponding percentage value. If you use a different method you could also linear along the time. Maybe you could show us how you animate the bar?

  • Robert Müller

    July 22, 2020 at 12:19 pm in reply to: Understanding layer/comp space transformation

    Thanks for the replies guys, but this didnt seem to work. Ive tried some more with just the positions of a null object driving an object in a scaled down precomp but its still offset. Ive attached a screenshot to illustrate the problem. The green mask on “comp2” is just to show you where the bounding box of the composition would be if I would switch collapse transformation off

  • Robert Müller

    July 10, 2020 at 8:40 am in reply to: How to loopOut(“pingpong”) with a variable

    You could use sine for this, like this maybe?
    spd = 5;
    fct = 3;
    s=Math.sin(time*spd)*3;
    [value[0]+s,value[1]]

    “spd” is the speed of the sine function and “fct” is by how much the value will change.

  • Robert Müller

    June 26, 2020 at 9:03 am in reply to: Lower Third > SourceRectAtTime()

    I assume your red box is a rectangular path in a shape layer as well? to link the other shape to the edge of your box you must link it to the width of the box.

  • Robert Müller

    June 25, 2020 at 8:43 am in reply to: Turbulent Displace is clipping

    You dont need to resize the bill. You could either use an adjustment layer on top of your image, which would also influence the layers below so you might want to precomp it. Or you could just precompose the image layer, ad the Turbulent Displace effect on the comp and check “collapse transformations” for the comp in your layer stack

  • Hi Andrew,
    No quotes for variables my friend ?
    colName = thisComp.layer("Type Col Name Here").text.sourceText;
    thisComp.layer("Population2019.csv")("Data")("Outline")(colName)(colName + " 0").value);

  • Robert Müller

    June 19, 2020 at 9:40 am in reply to: Expression to count up every X amount of frames

    Hi, this should do what you are looking for

    t=timeToFrames();
    frameStep=3;
    days=30;
    Math.floor(t/frameStep)%days+1

    this counts to 30 (or any number you put for “days”) every 3 frames (or any number you put for “frameStep”), starting at 1 and resetting back to 1 after 30.
    If you want to stop at 30 try this:
    t=timeToFrames();
    frameStep=3;
    f=Math.floor(t/frameStep)+1;
    if (f>30){30}else{f};

  • Hey Markus, Ive got no script for you but a quick tipp: If you hold shift while parenting a layer (even if its allready parented) the child moves to the location/rotation/orientation of the parent 🙂

  • Okay it seems like the pointOnPath expression needs a drawn path to calculate. But since you are using expressions to draw your path there should be other ways to calculate the mid point.

  • Hi Vadim,
    I quickly hacked this together, which plots a line for the scale value of a specific object. It might not be exactly what you are looking for but this should point you in the general direction and give you something to work with ☺

    yBase=400; //y Position the graph should "start" on.
    xStart=-900; //leftmost point of the graph
    xEnd=xStart*-1; //rightmost point of the graph
    fTotal= timeToFrames(thisComp.duration); // getting the total number of frames so that each frame will represent a point on the path
    xStep=length(xStart,xEnd)/fTotal; //distance between the points, steps
    pointArr = []; //creating an empty array
    lay= thisComp.layer("Object"); //the "watched" layer

    for (i=0; i<= fTotal; i++){
    pointArr.push([xStart+(i*xStep),yBase-(lay.transform.scale.valueAtTime(framesToTime(i))[0])])
    }
    /*
    I get the x position of each point on each frame, starting from the xStart value.
    Then I get the values of one of the scale dimensions on every frame and substract that from my yBase line.
    Then I push the value as x and y into my empty array
    */
    createPath(pointArr,[],[],isClosed=false);

    Since I dont go after tangents I added a round corners to the shape layer.
    And to have the graph animate I simply put this expression on the end property of a trim paths I added on my graph:
    linear(time,0,thisComp.duration,0,100)

Page 7 of 11

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