I'm trying to setup a system for some bar graphs I need to animate. I have everything done but I'm looking to add another option to help streamline my setup, but I'm not sure how. Basically I have the following position expression on all my layers, which allows me to keep the number of bars I have centered on the screen and controls the spacing between each one. Ideally I would like to add 2 additional slider controls, one that allows me to choose the number of groups and another that allows me to adjust spacing of the bars in the group. So instead of having multiple single bars spaced evenly I can have something like 3 bars spaced closely together then a bigger space then 3 more bars and so on. Like this. And hopefully the same expression can go be used on each layer so I don't have to modify the layers depending on the set up.
||| ||| ||| ||| or like |||| |||| |||| or || || || || ||
What you must do is to add a multiplier for each bar and group. Let's say you have group 1, group 2 and group 3. Name each bar like this "bar_1_1", "bar_2_1", "bar_1_2", etc... (first number for bar number and second for group number. Now you have to do two things: get the multipliers for each bar, and add two slider controls to your "Layout" layer: "bar_separation", "group_separation". Now you can write this:
Thanks Miguel. I was finally able to check it out. Is there an easy way to do this without changing name of layers? I assume that would require conditional statements. I would like to use another slider to control the grouping. For instance, if there are 6 bars total, and the slider control is set to 3 then it would be 2 groups of 3.
This may not be possible without either writing a specific expression for the layers that need to be grouped, or by the way you wrote it. I thought somehow using the modulus operator to determine the bar number where the separation would happen, but wasn't sure how to effect the other corresponding bars.
If you have any other ideas that would be awesome.