Polygon unfolding - replicate C4D mograph effect

I’m still a newb in Blender but was wondering if anyone had an idea to replicate something like this:

I thought I could tie a driver to each square, and I tested this but then didnt think I’d be able to randomize it effectively (like the blend in the video) and it seemed like overkill to have to have a driver tied to each square in the scene.

Maybe this is more a job for a custom python script? Not sure since I’m kinda new still and probably not aware of an easy way to do this…?

thanks!

Looks like someone else was also thinking of this: http://blendersushi.blogspot.com/2013/05/python-advanced-procedural-flipping.html
and his older stuff here http://blendersushi.blogspot.com/2012/02/vfx-multilayers-triggering-of-effects.html

I shall dig into this more… thanks Jimmy Gunawan for posting your tests