[V-Ray 5 Maya] How to achieve "By Poly Shell" randomization without upgrading to V-Ray 6?

Hi, I’m currently using V-Ray 5 with Maya 2023 and cannot upgrade at the moment.

I need to randomize textures across different Poly Shells within a single, combined mesh using VRayMultiSubTex. In V-Ray 6, this is easy with the “By Poly Shell” option, but it’s missing in V-Ray 5.

I’ve tried using SamplerInfo and VRayVertexColors with some scripts, but I’m having trouble getting it to recognize individual shells or getting more than 2 variations. My mesh is too heavy to use ‘Mesh Separate’ for performance reasons.

Is there a specific node setup or a script-based workaround to assign IDs per shell so that VRayMultiSubTex can recognize them in V-Ray 5?

Any advice would be greatly appreciated!

The old way of doing this was through the Sampler Info node (with additional attributes) that goes into a Ramp. There’s a setup demonstrated in this docs page.

Thank you so much! I was under the impression that I had to connect SamplerInfo directly to VRayMultiSubTex without using a Ramp. Your advice helped me clear that up, and it’s working perfectly now. I really appreciate your help!