I need a way to have multiple materials per polygon. Basically what I want is to have one "layer" of materials to create a colorID mask and another "layer" to export a mesh with the correct Texture Sets for Substance Painter (the latter creates a separate texture for each material the mesh has). In most of my cases the two don't match (I want multiple colorIDs on the same Texture Set-material) so I idealy need a way to have a single mesh, which I can dynamically change, while having two layers of materials on it, where I can disable/enable a single layer to make an export.
I thought of have a feeling that one can do it by splitting the object in blender into several objects and then writing a script that assigns a single material to each object, but It would be preferable for me to have a single object with two material layers.
Another idea I had is to use vertex groups, but they are invisible in viewport and should still be manually selected to apply materials every time before export (and I do export often). Maybe there is a modifier that can allow two cloned meshes on two different layers, both of which change whenever you change any of them, while maintaining unique materials on each layer?