Hi,
I think the script "layers_materials.rb" will help you.
What it does: "Manages layers and materials as the "color by layer" display mode does. 4 options to create layers or materials corresponding with materials and layers, to repaint faces based on their layer or to change their layer based on their materials."
Download it here:
http://www.crai.archi.fr/RubyLibraryDepot/Ruby/em_ren_page.htm
Hope this helps
📷 GIF Exporter 1.1 | create animated GIFs from SketchUp models with customizable settings
Download
D