Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Expression: Slider to control the number of vertices along a path

  • Expression: Slider to control the number of vertices along a path

  • Craig Sinclair

    January 10, 2023 at 4:51 pm

    I’m trying to design a universal line graph that’s driven by JSON files.

    I’ve made a good working project from a tutorial by Bring your own Laptop. His tutorial is based on a line graph with 12 data points.

    He creates a 12-point path and attaches nulls to each point, then an expression to position each null on his graph according to the data pulled from the JSON files

    In my scenario, I want a graph to be flexible in case I have a data set that has more or fewer data points.

    What I need is to add a slider where I can input the number of data points, which generates a corresponding number of vertices with nulls attached between the first and last vertice of a path.

    Does anyone know a way to go about this or is it a madman’s dream?

  • Dan Ebberts

    January 10, 2023 at 7:25 pm

    If you could format your data as a .csv file, you could import that and drag it into the timeline. When you do that, it generates a data element called “Number of Rows” which could drive the number of points on your graph. I think you could ditch the nulls and have a path expression for your line that would create the path points directly from the data in the .csv. A bit of work and design, but do-able, I think. Then you just replace the .csv file with a new data set and the line should adjust. The details would depend on the specific requirements of your graph.

  • Craig Sinclair

    January 10, 2023 at 8:03 pm

    Thanks I’ll give this a try. Maybe combine both methods

  • Dan Ebberts

    January 10, 2023 at 8:25 pm

    Come back if you have questions.

  • Tomas Bumbulevičius

    January 11, 2023 at 5:42 pm

    Depending on whether you want this to be also animated based on the amount of points in time (faster/slower animation), the idea can reach a bottleneck of complexity real fast.

    But despite of that, try to get rid of nulls as Dan suggested – otherwise solution will be always limited by amount of nulls you create, manually, and not dynamic to the extent you might expect to have.

Viewing 1 - 5 of 5 posts

Log in to reply.

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