Skip to main content
Inspiring
July 27, 2018
Question

Plotting points from json file - more efficient method?

  • July 27, 2018
  • 1 reply
  • 303 views

Hello,

I am currently working on a project where I'm plotting points from a json file on a 'bullseye' type graph. In this graph, each dot represents someone's score between 0 and 100. The closer the dot is to the center, the better their score is, and then the dots are distributed around the bullseye randomly.

This is my first attempt at connecting data to AE and I also have limited experience with expressions. I've been able to make it work as I intended, but as soon as I hit about 40 layers/dots, everything gets really slow (on my laptop at least). I've tried on a desktop gaming computer as well and that doesn't slow down until a few hundred dots in.

Each dot, which is a circular shape layer I created, has two expressions on it - one on the anchor point and one on the rotation. For the anchor point, I pull a value for each score/dot that represents the distance from the center and apply that to the y value. On rotation, I pull a random number between 0 and 360 to distribute the dots around the bullseye.

My question is - is there a more efficient way of doing this? This setup won't be sustainable for me, especially if I need to plot hundreds or thousands of data points. Can I attach these data values to particles instead? I have no experience with particle systems but it seems like that would be more efficient than shape layers.

Any help is greatly appreciated.

This topic has been closed for replies.

1 reply

Mylenium
Legend
July 27, 2018

Can I attach these data values to particles instead?

Not on anything that works in AE and this doesn't solve your problem - it's simply the overall expression evaluation that slows things down ad this is 100% dependent on brute single-core CPU speed. So unless you find a way that would bypass AE's expression engine entirely, nothing will change, regardless of what method you use to generate the dots.

Mylenium

Inspiring
July 27, 2018

Thanks for your response, Mylenium. This is the expression I'm using on the anchor point of each layer:

eval("var data=" + footage("dummy_data.json").sourceText);

var index = 628 - thisLayer.index;

var user = data[index].user;

var preAEDis = data[index].preAEDis;

transform.anchorPoint + [0,preAEDis];

The rotation expression is almost the exact same. '628' refers to the number of entries.

I'm unfamiliar with how scripting works in AE, but am wondering if this setup can be achieved through a script. It seems inefficient to pull the json file and redeclare the variables on every layer.

Thanks again for your assistance!