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
Tomas Bumbulevičius updated 2 months, 2 weeks ago 3 Members · 5 Posts
-
Craig Sinclair
January 10, 2023 at 4:51 pmI’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 pmIf 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.
-
Tomas Bumbulevičius
January 11, 2023 at 5:42 pmDepending 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.
Log in to reply.