Optimize each building group before export.