FORUMS: list search recent posts

AE If else expression for sorting elements?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ilio Crandi
AE If else expression for sorting elements?
on Jun 1, 2017 at 7:44:31 am

Hi everyone,
I am working on a project for some animations about election in After Effects CC.

I have all the comps,sub comps and elements for all political parties ready (i.e. photo of the candidate, party logo, etc). All animations (bars graphs, seat count, etc) are linked to two sliders for each party, one for percentage of votes, one for number of seats.

I am pretty new to expressions but what I am trying to achieve is this:

Based on the percentage of the votes and on the number of the seats gained I want the sub comps for the parties to auto arrange based on the ranking.
To make it clearer, if Party C gains the most votes, I want it to be on top, followed by the second best, etc etc.

I suppose I should use an If else expression, as I would do in excel for example, could somebody point me to the right direction on how to do this? Or maybe even suggest a better option?

Thanks very much for your help,
Regards.


Return to posts index

Cassius Marques
Re: AE If else expression for sorting elements?
on Jun 1, 2017 at 5:03:51 pm

[Ilio Crandi] "To make it clearer, if Party C gains the most votes, I want it to be on top,"

Explain please... What's the up vector you're refering? Y axis? Z axis? the layers number in the timeline panel?

You can sort values and use that information to drive the position property. You won't be able to rearange the layer order in your composition.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Ilio Crandi
Re: AE If else expression for sorting elements?
on Jun 1, 2017 at 5:50:44 pm

Apologies Cassius, I wasn't clear at all.
I meant on top in relation to the Y axis on a simple 2D composition, as you would expect when getting the results from a poll or a vote counting.
The most voted party on top, then the second, etc etc.
Somebody else suggested to me I should use an array of values and then sort them, I am not familiar with the procedure but I will investigate this option.
Any suggestions is welcome! ☺
Regards,


Return to posts index


Cassius Marques
Re: AE If else expression for sorting elements?
on Jun 1, 2017 at 6:32:36 pm

how are you planning to feed in the values? Can you provide a SS of an example formation so we can judge what needs to automate?

Cause if you're typing in the values, It's kind of easy to adjust the positions/scales, since its all limited by a total value of 100%.

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Cassius Marques
Re: AE If else expression for sorting elements?
on Jun 1, 2017 at 8:08:15 pm

I've made a quick example to show you how to sort value inputs into position. But I need way more info to help you more: 11422_bargraph.aep.zip

Cassius Marques
http://www.zapfilmes.com


Return to posts index

Ilio Crandi
Re: AE If else expression for sorting elements?
on Jun 1, 2017 at 9:12:09 pm

First of all,
thank you v much for your help, I really appreciate it.
I think your example can be useful, I will have to study it since I am not v familiar with expressions, but it seems like it could be a solution for me.

I'll show you what I am doing.

11423_seatslq.mp4.zip

As you can see all these elements are animated (the party logo, the candidate photo, the number of votes).
I insert the number of seats for each party as a slider value and this values populate the little men grid on the left and the round graph on the right.
I am happy with this, what I am missing is a sorting mechanism that will allow me, in the unlikely event that the red party gains more seats then the blue one, for example, to put the red party first on the order of the parties on the bottom of the page, and consequently changing the order in the little men and round graphs.

Ideally, this will allow me to deal with other graphics, like this one :



where party A and party B (the first and the second one in the vote ranking) will appear and swap positions automatically, based on the number of votes I will input in the slider control.

I don't know If I made clearer or if I have complicated things, in any case, I really appreciate your support!
I will go and analyse your example.

Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]