So I've asked this question a couple years ago, and unfortunately I only got one response and it didn't quite work for what I was trying to do. At the time I just did a work around and made it work, but now I'm hoping someone can help me with it again.
First off, I'm not very good with after effects expressions, but I do love the idea of being able to build little systems with them, so I spend a lot of time with trial and error and usually I'm able to figure things out, but this has got me stumped.
its basically a bar graph setup. My setup is 2 null object called "TR" & "BL" that defines the top left and bottom right area my layers stay in. Each bar layer is named "bar 1, bar 2, bar 3, etc...). Currently I can add any number of bars and they all stay within that area with even spacing between each, centered within the box. I would like to be able to add additional spacing between every 3rd, 4th or 5th... bar using a slider control. basically I would want to add two sliders one that defines how many bars should be in a group and one that adds this additional spacing.
I figured I needed to use the modulus operator in some way and probably a for loop to add the spacing to each layer, but honestly I'm completely stuck. The last time I posted this question the solution was to name the layers differently but that kind of defeats the purpose. the expression below is what I currently have on all my layers x position. Also maybe there is a more efficient/better way to do what I'm doing, but this is currently working for me. I'm pretty sure I have way too many parenthesis as well, but I haven't cleaned it up yet.
on Jan 23, 2019 at 8:39:41 am Last Edited By Kalleheikki Kannisto on Jan 23, 2019 at 8:49:18 am
Would be much easier to help you if it is possible to upload the file. Otherwise I would have to rebuild the project without any knowledge of what other expressions are in play, and the likelihood is high that I would just give you an answer that is unsuitable for other mechanics you have in the project.
I'm not 100% sure how to share projects but here it is, I hope. I work on this project a little more each year, because I pretty much don't do any more after effects animations, but I have one client that still wants to use me once a year on a big project with a lot of bar graphs and charts, so I figured I might as well have some fun with it and try to automate a lot of it.