Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using source text to scale a path

  • Using source text to scale a path

    Posted by Darren Case on January 6, 2020 at 4:41 pm

    I’m needing to create a bar graph that’s connected to a JSON file via Templater.

    I wont be using the mamoworld.json plug-in, since this project needs to be custom, but I’ve been following their tutorials.

    Thinking I can make the bars using a path with a thick stroke. Then use the “create nulls from path” action. Then somehow link the nulls position to the source text of the percentage. The percentage will be linked to the JSON file.

    The source text needs to drive the bars height.

    I’m not sure if that’ll work or how to even accomplish this. Thanks so much for your help!

    Darren Case replied 6 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    January 6, 2020 at 6:17 pm

    I think the best way is create a rectangle with no stroke. The height of this rectangle should be the 100% value. Then link it’s height to the source text of the percentage. Something like this, inside the size property. Modify Percentage Layer to what you have in project.

    L = parseInt(thisComp.layer("Percentage Layer").text.sourceText);
    [value[0], value[1]*L]

    Andrei
    My Envato portfolio.

  • Darren Case

    January 6, 2020 at 6:42 pm

    Awesome, thank you so much. It worked!

    I had to use… value[1]=L
    instead of value[1]*L

    *L made the bar go up to 10,000%.

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