Random selections with animation nodes
Euler Mixing

First, I want to tell how to mix between two eulers (Animate one euler into the other). The mixing factor will range between zero and one where zero means the first euler and one means the second euler and any factor in between zero and one is a linear interpolation between the two. It is clear that the factor for our animation will be the time, but lets worry about that later. The equation for the mixing (linearly interpolate) between two eulers $e_1$ and $e_2$ using the factor $\alpha$ is:

$$
e = (1-\alpha)e_1 + \alpha e_2
$$

Which is easily implemented in Animation Nodes as follows:



Now if I use the output as the rotation of an object and gradually increases the factor, I will get an animation like this where the $y$ value goes from zero to 180 gradually:



Now, if I want to utilize this to create an animation, I would use the current frame as the factor, but since the frame will change from zero to one in $\frac{1}{24}$ of the second, which is very fast. To slow it down, I will divide the the current frame by 24, that way, it will reach the maximum value (1) when the frame number becomes 24, because $\frac{24}{24} = 1$, so you see that the dominator of the division is actually the duration of the animation in frames. I will also add a minimum node to make sure the factor don't exceed one:



Now what if I want the animation to start at a certain frame? To achieve that, we have to make sure that the factor of mixing is zero for all the frames that preceeds the required start frame. To do that, we can subtract the start frame from the current time, making all the frames before it negative, if we then clamp the output to zero, all negative numbers will be zero and we would have achieved what we wanted, here is an example where we set the start frame to be 24:



Animating Objects

We are now ready to animate the list of objects you have. Lets say we have this setup:



If we want to animate the objects, we will multiply their matrices by a rotation matrix with an animated euler (Euler we computed in the foregoing section), like this:



If we want the animations to start at different frames, all we have to do is subtract those frames just as we learned before:



Since we clamped the factor, the objects will stay at their final orientation after the duration of the animation is finished.

If we want to change the rate of change of the animation, we can evaluate the factor at some interpolation having the same derivative as the one we want, for instance, to create an ease-in-out effect, we can evaluate the factor at a sinusoidal interpolation: