merge paths

Merge Path

ilirvg's picture

I am trying to achieve Merge Path effect as it is shown in the picture below. So basically if two white cubes will move in the opposite direction and when they are in front of each other they will get black colour. Is there any plugin that will make it easier to achieve this, or how can I achieve without plugins