How to map vertex index to material slot?

Were you able to find the answer?