I find creating an ID map in Blender using vertex colors is a lot simpler so I hope you don’t mind if I mention it as others might find it helpful as well. Simply select the faces you want, go into Vertex Paint, make sure “Face selection masking for painting” is enabled, pick the color you want, and then go to Paint > Set Vertex Colors. Rinse, repeat changing the colors for the different materials. In Substance Painter there is an option when baking the ID map called Color Source, change it to Vertex Color.