Your first ID pass
- Properties ▸ View Layer ▸ Passes ▸ tick Material ID.
- Open Material ID Export and set Output.
//matid/writes next to your blend file. - Press Render ID Pass. You get
MaterialID.png. - Press Export Swatches. You get
MaterialID.acoandMaterialID.csv.
Step 1 is the only one that is setup. The rest is export.