Blend shader multi mattes

Ive got a question regarding blend shaders and how to get the shaders within that node to be visible as IDs. Basically Ive got a product to render that has been given to me as one piece of geo, which is fine. The different areas of the packing have been broken out for labels using masks and there is a VrayMtl with a mask to create the packaging. This all works fine for the beauty. Now when I need IDs however, how can I get those VrayMtls to register as multiu-matte IDs? Ive tried assigning IDs to the shaders within the blend node, and Ive tried crypto-matte. In the end I did it the old fashioned way and manually setup RGB ID layers using surfaceShaders and shader overrides.

I know the material select element can pull out information about whats in a blend material as we do it all the time for carpaints. So is there a way to grab that info and use it for automated IDs?

I don’t think I fully understand the question. Can you attach some images and if possible a scene?
Are those separate objects using the same shader? Or the same blend material with different shaders in it? What objects/materials need what IDs?
Any additional details that can help me better understand this can help me come up with alternative solutions.

Thanks Alex. Ive attached a reference image of the product. The asset I was supplied is one piece of geo with one blend shader applied. The top colour, the labeling and the metallic lettering and colour strips are done done with different shaders plugged into the blend shader. Each of those shaders are masked using maps as usual. Top create ID mattes for the object I have top go in and manually override on an ID render layer to swap all the beauty shaders out for RGB lightSurface materials. Instead of manually creating ID layers, is there a way to have render elements work for all the sub-materials in a blend shader? Hope that makes more sense.

You could add material ID attributes to the shaders - Chaos Docs
You can then use a multi matte render element - only you’ll need to enable ‘use material ID’ in the multimatte.

This way, you can assign material ID attributes to the shaders that are connected to the blend material and in the multimatte you’ll have masks for only what’s shaded with a particular sub-material of the blend.
Is that something you can use for your project?

That was the original plan, but for some reason it didnt work when I tried it last time. Just got black outputs. Seems to be working now. I must’ve missed something. User error! Thanks Alex. Does cryptomatte work for blend shader sub-materials?

It only gets the top-level shader and masks the objects using it.

Ok good to know. Thanks Alex.